<?php
declare(strict_types=1);
namespace PlanningBundleMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20230317102855 extends AbstractMigration
{
public function up(Schema $schema): void
{
$this->addSql('CREATE TABLE planning_bundle__slot (id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid)\', slot_type_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(128) NOT NULL, time_start DATETIME NOT NULL, time_end DATETIME NOT NULL, time NUMERIC(20, 2) NOT NULL, api_id VARCHAR(256) DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, deleted_at DATETIME DEFAULT NULL, INDEX IDX_788927472B4AEE37 (slot_type_id), INDEX IDX_78892747B03A8386 (created_by_id), INDEX IDX_78892747896DBBDE (updated_by_id), INDEX IDX_78892747C76F1F52 (deleted_by_id), INDEX name (name), INDEX time_start (time_start), INDEX time (time), INDEX deleted_at (deleted_at), 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('CREATE TABLE planning_bundle__slot_type (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, color VARCHAR(7) NOT NULL, text_color VARCHAR(7) NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, deleted_at DATETIME DEFAULT NULL, is_active TINYINT(1) DEFAULT 1 NOT NULL, is_default TINYINT(1) NOT NULL, INDEX IDX_FCFE71DB03A8386 (created_by_id), INDEX IDX_FCFE71D896DBBDE (updated_by_id), INDEX IDX_FCFE71DC76F1F52 (deleted_by_id), INDEX color (color), INDEX text_color (text_color), INDEX name (name), INDEX is_active (is_active), INDEX is_default (is_default), INDEX deleted_at (deleted_at), 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('CREATE TABLE planning_bundle__slot_type_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_909017D6232D562B (object_id), FULLTEXT INDEX content (content), 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 planning_bundle__slot_user (id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid)\', slot_id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid)\', user_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)\', created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, deleted_at DATETIME DEFAULT NULL, INDEX IDX_E82667D59E5119C (slot_id), INDEX IDX_E82667DA76ED395 (user_id), INDEX IDX_E82667DB03A8386 (created_by_id), INDEX IDX_E82667D896DBBDE (updated_by_id), INDEX IDX_E82667DC76F1F52 (deleted_by_id), INDEX deleted_at (deleted_at), 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 planning_bundle__slot ADD CONSTRAINT FK_788927472B4AEE37 FOREIGN KEY (slot_type_id) REFERENCES planning_bundle__slot_type (id)');
$this->addSql('ALTER TABLE planning_bundle__slot ADD CONSTRAINT FK_78892747B03A8386 FOREIGN KEY (created_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE planning_bundle__slot ADD CONSTRAINT FK_78892747896DBBDE FOREIGN KEY (updated_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE planning_bundle__slot ADD CONSTRAINT FK_78892747C76F1F52 FOREIGN KEY (deleted_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE planning_bundle__slot_type ADD CONSTRAINT FK_FCFE71DB03A8386 FOREIGN KEY (created_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE planning_bundle__slot_type ADD CONSTRAINT FK_FCFE71D896DBBDE FOREIGN KEY (updated_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE planning_bundle__slot_type ADD CONSTRAINT FK_FCFE71DC76F1F52 FOREIGN KEY (deleted_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE planning_bundle__slot_type_translations ADD CONSTRAINT FK_909017D6232D562B FOREIGN KEY (object_id) REFERENCES planning_bundle__slot_type (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE planning_bundle__slot_user ADD CONSTRAINT FK_E82667D59E5119C FOREIGN KEY (slot_id) REFERENCES planning_bundle__slot (id)');
$this->addSql('ALTER TABLE planning_bundle__slot_user ADD CONSTRAINT FK_E82667DA76ED395 FOREIGN KEY (user_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE planning_bundle__slot_user ADD CONSTRAINT FK_E82667DB03A8386 FOREIGN KEY (created_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE planning_bundle__slot_user ADD CONSTRAINT FK_E82667D896DBBDE FOREIGN KEY (updated_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE planning_bundle__slot_user ADD CONSTRAINT FK_E82667DC76F1F52 FOREIGN KEY (deleted_by_id) REFERENCES user (id)');
}
public function down(Schema $schema): void
{
$this->addSql('ALTER TABLE planning_bundle__slot DROP FOREIGN KEY FK_788927472B4AEE37');
$this->addSql('ALTER TABLE planning_bundle__slot DROP FOREIGN KEY FK_78892747B03A8386');
$this->addSql('ALTER TABLE planning_bundle__slot DROP FOREIGN KEY FK_78892747896DBBDE');
$this->addSql('ALTER TABLE planning_bundle__slot DROP FOREIGN KEY FK_78892747C76F1F52');
$this->addSql('ALTER TABLE planning_bundle__slot_type DROP FOREIGN KEY FK_FCFE71DB03A8386');
$this->addSql('ALTER TABLE planning_bundle__slot_type DROP FOREIGN KEY FK_FCFE71D896DBBDE');
$this->addSql('ALTER TABLE planning_bundle__slot_type DROP FOREIGN KEY FK_FCFE71DC76F1F52');
$this->addSql('ALTER TABLE planning_bundle__slot_type_translations DROP FOREIGN KEY FK_909017D6232D562B');
$this->addSql('ALTER TABLE planning_bundle__slot_user DROP FOREIGN KEY FK_E82667D59E5119C');
$this->addSql('ALTER TABLE planning_bundle__slot_user DROP FOREIGN KEY FK_E82667DA76ED395');
$this->addSql('ALTER TABLE planning_bundle__slot_user DROP FOREIGN KEY FK_E82667DB03A8386');
$this->addSql('ALTER TABLE planning_bundle__slot_user DROP FOREIGN KEY FK_E82667D896DBBDE');
$this->addSql('ALTER TABLE planning_bundle__slot_user DROP FOREIGN KEY FK_E82667DC76F1F52');
$this->addSql('DROP TABLE planning_bundle__slot');
$this->addSql('DROP TABLE planning_bundle__slot_type');
$this->addSql('DROP TABLE planning_bundle__slot_type_translations');
$this->addSql('DROP TABLE planning_bundle__slot_user');
}
}