<?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 Version20251125094221 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 t_chapter (id INT AUTO_INCREMENT NOT NULL, translatable_id INT DEFAULT NULL, locale VARCHAR(8) NOT NULL, value LONGTEXT DEFAULT NULL, INDEX IDX_A3AD0D4D2C2AC5D3 (translatable_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE t_chapter ADD CONSTRAINT FK_A3AD0D4D2C2AC5D3 FOREIGN KEY (translatable_id) REFERENCES chapter (id)');
$this->addSql('ALTER TABLE chapter DROP name');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE t_chapter DROP FOREIGN KEY FK_A3AD0D4D2C2AC5D3');
$this->addSql('DROP TABLE t_chapter');
$this->addSql('ALTER TABLE chapter ADD name VARCHAR(255) NOT NULL');
}
}