addSql('CREATE TABLE group_of_products (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'); $this->addSql('CREATE TABLE group_of_products_product (group_of_products_id INT NOT NULL, product_id INT NOT NULL, INDEX IDX_ABD75153748B7BD1 (group_of_products_id), INDEX IDX_ABD751534584665A (product_id), PRIMARY KEY(group_of_products_id, product_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'); $this->addSql('ALTER TABLE group_of_products_product ADD CONSTRAINT FK_ABD75153748B7BD1 FOREIGN KEY (group_of_products_id) REFERENCES group_of_products (id) ON DELETE CASCADE'); $this->addSql('ALTER TABLE group_of_products_product ADD CONSTRAINT FK_ABD751534584665A FOREIGN KEY (product_id) REFERENCES product (id) ON DELETE CASCADE'); $this->addSql('ALTER TABLE user ADD current_festival LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:object)\''); } public function down(Schema $schema): void { // this down() migration is auto-generated, please modify it to your needs $this->addSql('ALTER TABLE group_of_products_product DROP FOREIGN KEY FK_ABD75153748B7BD1'); $this->addSql('ALTER TABLE group_of_products_product DROP FOREIGN KEY FK_ABD751534584665A'); $this->addSql('DROP TABLE group_of_products'); $this->addSql('DROP TABLE group_of_products_product'); $this->addSql('ALTER TABLE user DROP current_festival'); } }