Files
haushalt/backend/migrations/Version20260331120000.php
Marek Lenczewski b6a4548732 update
2026-03-31 17:13:10 +02:00

28 lines
800 B
PHP

<?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');
}
}