<?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 Version20250321021913 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 dtb_faq (id INT UNSIGNED AUTO_INCREMENT NOT NULL, faq_category_id INT UNSIGNED DEFAULT NULL, title VARCHAR(255) NOT NULL, question LONGTEXT DEFAULT NULL, answer LONGTEXT DEFAULT NULL, sort_no INT DEFAULT NULL, discriminator_type VARCHAR(255) NOT NULL, INDEX IDX_15046F58F689B0DB (faq_category_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_bin` ENGINE = InnoDB');
$this->addSql('CREATE TABLE dtb_faq_category (id INT UNSIGNED AUTO_INCREMENT NOT NULL, title VARCHAR(255) NOT NULL, sort_no INT DEFAULT NULL, discriminator_type VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_bin` ENGINE = InnoDB');
$this->addSql('ALTER TABLE dtb_faq ADD CONSTRAINT FK_15046F58F689B0DB FOREIGN KEY (faq_category_id) REFERENCES dtb_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 dtb_faq DROP FOREIGN KEY FK_15046F58F689B0DB');
$this->addSql('DROP TABLE dtb_faq');
$this->addSql('DROP TABLE dtb_faq_category');
}
}