<?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 Version20211010071935 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 price_list (id INT AUTO_INCREMENT NOT NULL, price_map_id INT DEFAULT NULL, grams INT DEFAULT NULL, height INT NOT NULL, width INT NOT NULL, depth INT NOT NULL, min_quantity INT NOT NULL, max_quantity INT NOT NULL, price_per_unit NUMERIC(12, 4) NOT NULL, units VARCHAR(255) DEFAULT NULL, uuid CHAR(36) NOT NULL COMMENT \'(DC2Type:uuid)\', UNIQUE INDEX UNIQ_399A0AA2D17F50A6 (uuid), INDEX IDX_399A0AA21E5CF734 (price_map_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE price_map (id INT AUTO_INCREMENT NOT NULL, manufacturer_id INT DEFAULT NULL, code VARCHAR(255) NOT NULL, packaging_types LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:json)\', pouch_types LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:json)\', segments LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:json)\', structures LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:json)\', varnishes LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:json)\', pouch_options LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:json)\', sustainable TINYINT(1) NOT NULL, uuid CHAR(36) NOT NULL COMMENT \'(DC2Type:uuid)\', UNIQUE INDEX UNIQ_C6C1A134D17F50A6 (uuid), INDEX IDX_C6C1A134A23B42D (manufacturer_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE price_list ADD CONSTRAINT FK_399A0AA21E5CF734 FOREIGN KEY (price_map_id) REFERENCES price_map (id)');
$this->addSql('ALTER TABLE price_map ADD CONSTRAINT FK_C6C1A134A23B42D FOREIGN KEY (manufacturer_id) REFERENCES manufacturer (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE price_list DROP FOREIGN KEY FK_399A0AA21E5CF734');
$this->addSql('DROP TABLE price_list');
$this->addSql('DROP TABLE price_map');
}
}