<?php
declare(strict_types=1);
namespace CoreMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20220609141952 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 labels_bundle__label (id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid)\', product_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', declination_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', created_by_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', updated_by_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', deleted_by_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', stock_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', name VARCHAR(255) NOT NULL, source VARCHAR(255) DEFAULT NULL, summary VARCHAR(255) DEFAULT NULL, description LONGTEXT DEFAULT NULL, reference VARCHAR(255) DEFAULT NULL, reference_brand VARCHAR(255) DEFAULT NULL, ean13 VARCHAR(13) DEFAULT NULL, wholesale_price NUMERIC(20, 6) DEFAULT NULL, sell_price NUMERIC(20, 6) DEFAULT NULL, attribute VARCHAR(255) DEFAULT NULL, batch_number VARCHAR(64) DEFAULT NULL, date_type_name VARCHAR(50) DEFAULT NULL, date_type_long_name VARCHAR(255) DEFAULT NULL, limit_date DATETIME DEFAULT NULL, custom_text LONGTEXT DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, deleted_at DATETIME DEFAULT NULL, INDEX IDX_18741D9C4584665A (product_id), INDEX IDX_18741D9C9941A932 (declination_id), INDEX IDX_18741D9CB03A8386 (created_by_id), INDEX IDX_18741D9C896DBBDE (updated_by_id), INDEX IDX_18741D9CC76F1F52 (deleted_by_id), INDEX IDX_18741D9CDCD6110 (stock_id), INDEX name (name), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE labels_bundle__label_context (id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid)\', label_id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid)\', context_id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid)\', INDEX IDX_2810AB2733B92F39 (label_id), INDEX IDX_2810AB276B00C1CF (context_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE labels_bundle__label_translations (id INT AUTO_INCREMENT NOT NULL, object_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', locale VARCHAR(8) NOT NULL, field VARCHAR(32) NOT NULL, content LONGTEXT DEFAULT NULL, INDEX IDX_FA0E8E67232D562B (object_id), UNIQUE INDEX lookup_unique_idx (locale, object_id, field), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE labels_bundle__printer (id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid)\', created_by_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', updated_by_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', deleted_by_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', name VARCHAR(128) NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, deleted_at DATETIME DEFAULT NULL, INDEX IDX_CE72EEE1B03A8386 (created_by_id), INDEX IDX_CE72EEE1896DBBDE (updated_by_id), INDEX IDX_CE72EEE1C76F1F52 (deleted_by_id), INDEX name (name), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE labels_bundle__template (id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid)\', context_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', created_by_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', updated_by_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', deleted_by_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', name VARCHAR(255) NOT NULL, content LONGTEXT DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, deleted_at DATETIME DEFAULT NULL, is_default TINYINT(1) NOT NULL, INDEX IDX_9E956D3F6B00C1CF (context_id), INDEX IDX_9E956D3FB03A8386 (created_by_id), INDEX IDX_9E956D3F896DBBDE (updated_by_id), INDEX IDX_9E956D3FC76F1F52 (deleted_by_id), INDEX name (name), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE labels_bundle__label ADD CONSTRAINT FK_18741D9C4584665A FOREIGN KEY (product_id) REFERENCES products_bundle__product (id)');
$this->addSql('ALTER TABLE labels_bundle__label ADD CONSTRAINT FK_18741D9C9941A932 FOREIGN KEY (declination_id) REFERENCES products_bundle__declination (id)');
$this->addSql('ALTER TABLE labels_bundle__label ADD CONSTRAINT FK_18741D9CB03A8386 FOREIGN KEY (created_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE labels_bundle__label ADD CONSTRAINT FK_18741D9C896DBBDE FOREIGN KEY (updated_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE labels_bundle__label ADD CONSTRAINT FK_18741D9CC76F1F52 FOREIGN KEY (deleted_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE labels_bundle__label ADD CONSTRAINT FK_18741D9CDCD6110 FOREIGN KEY (stock_id) REFERENCES stocks_bundle__stock (id)');
$this->addSql('ALTER TABLE labels_bundle__label_context ADD CONSTRAINT FK_2810AB2733B92F39 FOREIGN KEY (label_id) REFERENCES labels_bundle__label (id)');
$this->addSql('ALTER TABLE labels_bundle__label_context ADD CONSTRAINT FK_2810AB276B00C1CF FOREIGN KEY (context_id) REFERENCES context (id)');
$this->addSql('ALTER TABLE labels_bundle__label_translations ADD CONSTRAINT FK_FA0E8E67232D562B FOREIGN KEY (object_id) REFERENCES labels_bundle__label (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE labels_bundle__printer ADD CONSTRAINT FK_CE72EEE1B03A8386 FOREIGN KEY (created_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE labels_bundle__printer ADD CONSTRAINT FK_CE72EEE1896DBBDE FOREIGN KEY (updated_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE labels_bundle__printer ADD CONSTRAINT FK_CE72EEE1C76F1F52 FOREIGN KEY (deleted_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE labels_bundle__template ADD CONSTRAINT FK_9E956D3F6B00C1CF FOREIGN KEY (context_id) REFERENCES context (id)');
$this->addSql('ALTER TABLE labels_bundle__template ADD CONSTRAINT FK_9E956D3FB03A8386 FOREIGN KEY (created_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE labels_bundle__template ADD CONSTRAINT FK_9E956D3F896DBBDE FOREIGN KEY (updated_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE labels_bundle__template ADD CONSTRAINT FK_9E956D3FC76F1F52 FOREIGN KEY (deleted_by_id) REFERENCES user (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE labels_bundle__label_context DROP FOREIGN KEY FK_2810AB2733B92F39');
$this->addSql('ALTER TABLE labels_bundle__label_translations DROP FOREIGN KEY FK_FA0E8E67232D562B');
$this->addSql('DROP TABLE labels_bundle__label');
$this->addSql('DROP TABLE labels_bundle__label_context');
$this->addSql('DROP TABLE labels_bundle__label_translations');
$this->addSql('DROP TABLE labels_bundle__printer');
$this->addSql('DROP TABLE labels_bundle__template');
}
}