<?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 Version20220913142558 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 cal_faq_category (id INT AUTO_INCREMENT NOT NULL, title_id INT DEFAULT NULL, description_id INT DEFAULT NULL, position INT NOT NULL, UNIQUE INDEX UNIQ_E1E36D2A9F87BD (title_id), UNIQUE INDEX UNIQ_E1E36D2D9F966B (description_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE cal_faq_item (id INT AUTO_INCREMENT NOT NULL, title_id INT DEFAULT NULL, description_id INT DEFAULT NULL, category_id INT DEFAULT NULL, position INT NOT NULL, UNIQUE INDEX UNIQ_AC54C927A9F87BD (title_id), UNIQUE INDEX UNIQ_AC54C927D9F966B (description_id), INDEX IDX_AC54C92712469DE2 (category_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE cal_faq_category ADD CONSTRAINT FK_E1E36D2A9F87BD FOREIGN KEY (title_id) REFERENCES cal_translation (id)');
$this->addSql('ALTER TABLE cal_faq_category ADD CONSTRAINT FK_E1E36D2D9F966B FOREIGN KEY (description_id) REFERENCES cal_translation (id)');
$this->addSql('ALTER TABLE cal_faq_item ADD CONSTRAINT FK_AC54C927A9F87BD FOREIGN KEY (title_id) REFERENCES cal_translation (id)');
$this->addSql('ALTER TABLE cal_faq_item ADD CONSTRAINT FK_AC54C927D9F966B FOREIGN KEY (description_id) REFERENCES cal_translation (id)');
$this->addSql('ALTER TABLE cal_faq_item ADD CONSTRAINT FK_AC54C92712469DE2 FOREIGN KEY (category_id) REFERENCES cal_faq_category (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE cal_faq_category DROP FOREIGN KEY FK_E1E36D2A9F87BD');
$this->addSql('ALTER TABLE cal_faq_category DROP FOREIGN KEY FK_E1E36D2D9F966B');
$this->addSql('ALTER TABLE cal_faq_item DROP FOREIGN KEY FK_AC54C927A9F87BD');
$this->addSql('ALTER TABLE cal_faq_item DROP FOREIGN KEY FK_AC54C927D9F966B');
$this->addSql('ALTER TABLE cal_faq_item DROP FOREIGN KEY FK_AC54C92712469DE2');
$this->addSql('DROP TABLE cal_faq_category');
$this->addSql('DROP TABLE cal_faq_item');
}
}