<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20240206071517 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('ALTER TABLE header_menu DROP FOREIGN KEY FK_D081401E95C43776');
$this->addSql('ALTER TABLE header_menu_translations DROP FOREIGN KEY FK_B10C0A22C2AC5D3');
$this->addSql('ALTER TABLE mail_template_translate DROP FOREIGN KEY FK_675E581E2C2AC5D3');
$this->addSql('ALTER TABLE static_pages DROP FOREIGN KEY FK_9BE40C2F727ACA70');
$this->addSql('ALTER TABLE static_pages DROP FOREIGN KEY FK_9BE40C2F73E8DD26');
$this->addSql('ALTER TABLE static_pages_translation DROP FOREIGN KEY FK_FCA250372C2AC5D3');
$this->addSql('DROP TABLE header_menu');
$this->addSql('DROP TABLE header_menu_translations');
$this->addSql('DROP TABLE mail_template_translate');
$this->addSql('DROP TABLE static_pages');
$this->addSql('DROP TABLE static_pages_translation');
$this->addSql('ALTER TABLE mail_template ADD subject VARCHAR(191) NOT NULL, ADD body LONGTEXT NOT NULL, ADD plain_body LONGTEXT NOT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE TABLE header_menu (id INT AUTO_INCREMENT NOT NULL, static_page_id INT DEFAULT NULL, position INT UNSIGNED DEFAULT NULL, type SMALLINT NOT NULL, link VARCHAR(191) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, slug VARCHAR(191) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, created_at DATETIME DEFAULT NULL, updated_at DATETIME DEFAULT NULL, active SMALLINT DEFAULT 0 NOT NULL, INDEX IDX_D081401E95C43776 (static_page_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
$this->addSql('CREATE TABLE header_menu_translations (id INT AUTO_INCREMENT NOT NULL, translatable_id INT DEFAULT NULL, title VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, locale VARCHAR(10) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, UNIQUE INDEX header_menu_translations_unique_translation (translatable_id, locale), INDEX IDX_B10C0A22C2AC5D3 (translatable_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
$this->addSql('CREATE TABLE mail_template_translate (id INT AUTO_INCREMENT NOT NULL, translatable_id INT DEFAULT NULL, subject VARCHAR(191) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, body LONGTEXT CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, plain_body LONGTEXT CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, locale VARCHAR(5) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, UNIQUE INDEX mail_template_translate_unique_translation (translatable_id, locale), INDEX IDX_675E581E2C2AC5D3 (translatable_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
$this->addSql('CREATE TABLE static_pages (id INT AUTO_INCREMENT NOT NULL, parent_id INT DEFAULT NULL, meta_image_id INT DEFAULT NULL, lft INT NOT NULL, lvl INT NOT NULL, rgt INT NOT NULL, created_at DATETIME DEFAULT NULL, updated_at DATETIME DEFAULT NULL, active SMALLINT DEFAULT 0 NOT NULL, slug VARCHAR(191) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, title_for_slug VARCHAR(191) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, INDEX IDX_9BE40C2F73E8DD26 (meta_image_id), UNIQUE INDEX UNIQ_9BE40C2F989D9B62 (slug), INDEX IDX_9BE40C2F727ACA70 (parent_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
$this->addSql('CREATE TABLE static_pages_translation (id INT AUTO_INCREMENT NOT NULL, translatable_id INT DEFAULT NULL, locale VARCHAR(10) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, title VARCHAR(191) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, content LONGTEXT CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, meta_title VARCHAR(191) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, meta_keywords VARCHAR(191) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, meta_description LONGTEXT CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, meta_canonical VARCHAR(191) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, UNIQUE INDEX static_pages_translation_unique_translation (translatable_id, locale), INDEX IDX_FCA250372C2AC5D3 (translatable_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
$this->addSql('ALTER TABLE header_menu ADD CONSTRAINT FK_D081401E95C43776 FOREIGN KEY (static_page_id) REFERENCES static_pages (id) ON UPDATE NO ACTION ON DELETE CASCADE');
$this->addSql('ALTER TABLE header_menu_translations ADD CONSTRAINT FK_B10C0A22C2AC5D3 FOREIGN KEY (translatable_id) REFERENCES header_menu (id) ON UPDATE NO ACTION ON DELETE CASCADE');
$this->addSql('ALTER TABLE mail_template_translate ADD CONSTRAINT FK_675E581E2C2AC5D3 FOREIGN KEY (translatable_id) REFERENCES mail_template (id) ON UPDATE NO ACTION ON DELETE CASCADE');
$this->addSql('ALTER TABLE static_pages ADD CONSTRAINT FK_9BE40C2F727ACA70 FOREIGN KEY (parent_id) REFERENCES static_pages (id) ON UPDATE NO ACTION ON DELETE SET NULL');
$this->addSql('ALTER TABLE static_pages ADD CONSTRAINT FK_9BE40C2F73E8DD26 FOREIGN KEY (meta_image_id) REFERENCES media__media (id) ON UPDATE NO ACTION ON DELETE SET NULL');
$this->addSql('ALTER TABLE static_pages_translation ADD CONSTRAINT FK_FCA250372C2AC5D3 FOREIGN KEY (translatable_id) REFERENCES static_pages (id) ON UPDATE NO ACTION ON DELETE CASCADE');
$this->addSql('ALTER TABLE mail_template DROP subject, DROP body, DROP plain_body');
}
}