This commit is contained in:
Marek Lenczewski
2026-03-31 17:13:10 +02:00
parent 576bfed36d
commit b6a4548732
13 changed files with 99 additions and 36 deletions

View File

@@ -0,0 +1,27 @@
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20260331120000 extends AbstractMigration
{
public function getDescription(): string
{
return 'Remove categoryOverridden: backfill task.category_id from schema, then drop column';
}
public function up(Schema $schema): void
{
$this->addSql('UPDATE task t INNER JOIN task_schema ts ON t.task_id = ts.id SET t.category_id = ts.category_id WHERE t.category_overridden = 0');
$this->addSql('ALTER TABLE task DROP category_overridden');
}
public function down(Schema $schema): void
{
$this->addSql('ALTER TABLE task ADD category_overridden TINYINT(1) NOT NULL DEFAULT 0');
}
}