update
This commit is contained in:
27
backend/migrations/Version20260331120000.php
Normal file
27
backend/migrations/Version20260331120000.php
Normal 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');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user