fix(workflow) : couleurs par defaut par categorie + migration de correction du workflow Standard
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
37
migrations/Version20260521094948.php
Normal file
37
migrations/Version20260521094948.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace DoctrineMigrations;
|
||||
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Doctrine\Migrations\AbstractMigration;
|
||||
|
||||
final class Version20260521094948 extends AbstractMigration
|
||||
{
|
||||
public function getDescription(): string
|
||||
{
|
||||
return 'Remet les couleurs classiques sur les statuts du workflow Standard (derive data prod).';
|
||||
}
|
||||
|
||||
public function up(Schema $schema): void
|
||||
{
|
||||
$map = [
|
||||
'todo' => '#222783',
|
||||
'in_progress' => '#4A90D9',
|
||||
'blocked' => '#C62828',
|
||||
'review' => '#FF8F00',
|
||||
'done' => '#26A69A',
|
||||
];
|
||||
foreach ($map as $category => $hex) {
|
||||
$this->addSql(
|
||||
"UPDATE task_status SET color = '".$hex."' WHERE category = '".$category."' AND workflow_id = (SELECT id FROM workflow WHERE name = 'Standard' ORDER BY id ASC LIMIT 1)"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
$this->throwIrreversibleMigration('Correction de couleurs non reversible.');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user