<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20220928115106 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE TABLE marketing_cost (id INT AUTO_INCREMENT NOT NULL, product_id INT NOT NULL, country_id INT NOT NULL, tracker_id INT DEFAULT NULL, customer_id INT DEFAULT NULL, cost_type VARCHAR(255) NOT NULL, cost NUMERIC(10, 2) NOT NULL, date DATETIME(6) NOT NULL, INDEX IDX_9A0176A44584665A (product_id), INDEX IDX_9A0176A4F92F3E70 (country_id), INDEX IDX_9A0176A4FB5230B (tracker_id), INDEX IDX_9A0176A49395C3F3 (customer_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE marketing_cost ADD CONSTRAINT FK_9A0176A44584665A FOREIGN KEY (product_id) REFERENCES product (id)');
$this->addSql('ALTER TABLE marketing_cost ADD CONSTRAINT FK_9A0176A4F92F3E70 FOREIGN KEY (country_id) REFERENCES country (id)');
$this->addSql('ALTER TABLE marketing_cost ADD CONSTRAINT FK_9A0176A4FB5230B FOREIGN KEY (tracker_id) REFERENCES tracker (id)');
$this->addSql('ALTER TABLE marketing_cost ADD CONSTRAINT FK_9A0176A49395C3F3 FOREIGN KEY (customer_id) REFERENCES user (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('DROP TABLE marketing_cost');
}
}