<?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 Version20231211082932 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 menu (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)\', name VARCHAR(255) NOT NULL, position INT DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, INDEX IDX_7D053A93B03A8386 (created_by_id), INDEX IDX_7D053A93896DBBDE (updated_by_id), INDEX name (name), INDEX position (position), INDEX created_at (created_at), INDEX updated_at (updated_at), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE menu ADD CONSTRAINT FK_7D053A93B03A8386 FOREIGN KEY (created_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE menu ADD CONSTRAINT FK_7D053A93896DBBDE FOREIGN KEY (updated_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE projects_bundle__task_time ADD slot_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\'');
$this->addSql('ALTER TABLE projects_bundle__task_time ADD CONSTRAINT FK_3040BF2759E5119C FOREIGN KEY (slot_id) REFERENCES planning_bundle__slot (id)');
$this->addSql('CREATE INDEX IDX_3040BF2759E5119C ON projects_bundle__task_time (slot_id)');
$this->addSql('ALTER TABLE tax ADD manufactured_pack_sales_account_number VARCHAR(32) DEFAULT NULL');
$this->addSql('CREATE INDEX manufactured_pack_sales_account_number ON tax (manufactured_pack_sales_account_number)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE menu DROP FOREIGN KEY FK_7D053A93B03A8386');
$this->addSql('ALTER TABLE menu DROP FOREIGN KEY FK_7D053A93896DBBDE');
$this->addSql('DROP TABLE menu');
$this->addSql('ALTER TABLE projects_bundle__task_time DROP FOREIGN KEY FK_3040BF2759E5119C');
$this->addSql('DROP INDEX IDX_3040BF2759E5119C ON projects_bundle__task_time');
$this->addSql('ALTER TABLE projects_bundle__task_time DROP slot_id');
$this->addSql('DROP INDEX manufactured_pack_sales_account_number ON tax');
$this->addSql('ALTER TABLE tax DROP manufactured_pack_sales_account_number');
}
}