src/Migrations/Version20230808090714.php line 1
<?phpdeclare(strict_types=1);namespace DoctrineMigrations;use Doctrine\DBAL\Schema\Schema;use Doctrine\Migrations\AbstractMigration;/*** Auto-generated Migration: Please modify to your needs!*/final class Version20230808090714 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 faq (id INT AUTO_INCREMENT NOT NULL, created_by_id INT DEFAULT NULL, updated_by_id INT DEFAULT NULL, publish_at DATETIME DEFAULT NULL COMMENT \'(DC2Type:datetime_immutable)\', deleted TINYINT(1) DEFAULT 0 NOT NULL, created_at DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL, updated_at DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL, weight INT DEFAULT 10 NOT NULL, active TINYINT(1) DEFAULT 1 NOT NULL, owner_uuid VARCHAR(36) DEFAULT NULL, owner_active TINYINT(1) DEFAULT 1 NOT NULL, owner_deleted TINYINT(1) DEFAULT 0 NOT NULL, INDEX IDX_E8FF75CCB03A8386 (created_by_id), INDEX IDX_E8FF75CC896DBBDE (updated_by_id), INDEX idx_active (deleted, active, weight, publish_at), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');$this->addSql('CREATE TABLE faq_translation (id INT AUTO_INCREMENT NOT NULL, translatable_id INT DEFAULT NULL, caption VARCHAR(255) DEFAULT NULL, text LONGTEXT DEFAULT NULL, locale VARCHAR(5) NOT NULL, INDEX IDX_50A668562C2AC5D3 (translatable_id), UNIQUE INDEX faq_translation_unique_translation (translatable_id, locale), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');$this->addSql('ALTER TABLE faq ADD CONSTRAINT FK_E8FF75CCB03A8386 FOREIGN KEY (created_by_id) REFERENCES users (id) ON DELETE SET NULL');$this->addSql('ALTER TABLE faq ADD CONSTRAINT FK_E8FF75CC896DBBDE FOREIGN KEY (updated_by_id) REFERENCES users (id) ON DELETE SET NULL');$this->addSql('ALTER TABLE faq_translation ADD CONSTRAINT FK_50A668562C2AC5D3 FOREIGN KEY (translatable_id) REFERENCES faq (id) ON DELETE CASCADE');$this->addSql('ALTER TABLE gallery_album ADD preview_id INT DEFAULT NULL, ADD publish TINYINT(1) DEFAULT 1 NOT NULL');$this->addSql('ALTER TABLE gallery_album ADD CONSTRAINT FK_DD05BE60CDE46FDB FOREIGN KEY (preview_id) REFERENCES files (id)');$this->addSql('CREATE INDEX IDX_DD05BE60CDE46FDB ON gallery_album (preview_id)');$this->addSql('ALTER TABLE gallery_group ADD preview_id INT DEFAULT NULL');$this->addSql('ALTER TABLE gallery_group ADD CONSTRAINT FK_895D94E6CDE46FDB FOREIGN KEY (preview_id) REFERENCES files (id)');$this->addSql('CREATE INDEX IDX_895D94E6CDE46FDB ON gallery_group (preview_id)');$this->addSql('ALTER TABLE smi_item_translation ADD short_text VARCHAR(255) DEFAULT NULL');}public function down(Schema $schema): void{// this down() migration is auto-generated, please modify it to your needs$this->addSql('ALTER TABLE faq DROP FOREIGN KEY FK_E8FF75CCB03A8386');$this->addSql('ALTER TABLE faq DROP FOREIGN KEY FK_E8FF75CC896DBBDE');$this->addSql('ALTER TABLE faq_translation DROP FOREIGN KEY FK_50A668562C2AC5D3');$this->addSql('DROP TABLE faq');$this->addSql('DROP TABLE faq_translation');$this->addSql('ALTER TABLE gallery_album DROP FOREIGN KEY FK_DD05BE60CDE46FDB');$this->addSql('DROP INDEX IDX_DD05BE60CDE46FDB ON gallery_album');$this->addSql('ALTER TABLE gallery_album DROP preview_id, DROP publish');$this->addSql('ALTER TABLE gallery_group DROP FOREIGN KEY FK_895D94E6CDE46FDB');$this->addSql('DROP INDEX IDX_895D94E6CDE46FDB ON gallery_group');$this->addSql('ALTER TABLE gallery_group DROP preview_id');$this->addSql('ALTER TABLE smi_item_translation DROP short_text');}}