diff --git a/migrations/Version20260519175338.php b/migrations/Version20260519175338.php index 6a43497..244b782 100644 --- a/migrations/Version20260519175338.php +++ b/migrations/Version20260519175338.php @@ -21,6 +21,8 @@ final class Version20260519175338 extends AbstractMigration $this->addSql('DROP INDEX uniq_workflow_one_default'); $this->addSql('ALTER TABLE workflow ALTER id DROP DEFAULT'); $this->addSql('ALTER TABLE workflow ALTER id ADD GENERATED BY DEFAULT AS IDENTITY'); + // Aligner la séquence d'identity sur MAX(id) pour éviter le conflit avec les rows déjà insérés par M1 + $this->addSql('SELECT setval(pg_get_serial_sequence(\'workflow\', \'id\'), COALESCE((SELECT MAX(id) FROM workflow), 0) + 1, false)'); $this->addSql('ALTER INDEX uniq_workflow_name RENAME TO UNIQ_65C598165E237E06'); }