<?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 Version20220325172504 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 customer_target_price (id INT AUTO_INCREMENT NOT NULL, structure_id INT DEFAULT NULL, quotation_id INT NOT NULL, type VARCHAR(255) NOT NULL, price JSON NOT NULL, comment LONGTEXT DEFAULT NULL, uuid CHAR(36) NOT NULL COMMENT \'(DC2Type:uuid)\', UNIQUE INDEX UNIQ_78BB7ACCD17F50A6 (uuid), INDEX IDX_78BB7ACC2534008B (structure_id), INDEX IDX_78BB7ACCB4EA4E60 (quotation_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE customer_target_price ADD CONSTRAINT FK_78BB7ACC2534008B FOREIGN KEY (structure_id) REFERENCES material (id)');
$this->addSql('ALTER TABLE customer_target_price ADD CONSTRAINT FK_78BB7ACCB4EA4E60 FOREIGN KEY (quotation_id) REFERENCES customer_quotations (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('DROP TABLE customer_target_price');
}
}