diff --git a/migrations/Version20260519175041.php b/migrations/Version20260519175041.php new file mode 100644 index 0000000..f8ecaa8 --- /dev/null +++ b/migrations/Version20260519175041.php @@ -0,0 +1,36 @@ +addSql('CREATE TABLE workflow ( + id SERIAL NOT NULL, + name VARCHAR(255) NOT NULL, + is_default BOOLEAN DEFAULT FALSE NOT NULL, + position INT DEFAULT 0 NOT NULL, + PRIMARY KEY (id) + )'); + $this->addSql('CREATE UNIQUE INDEX uniq_workflow_name ON workflow (name)'); + $this->addSql('CREATE UNIQUE INDEX uniq_workflow_one_default ON workflow (is_default) WHERE is_default = TRUE'); + + $this->addSql("INSERT INTO workflow (name, is_default, position) VALUES ('Standard', TRUE, 0)"); + } + + public function down(Schema $schema): void + { + $this->addSql('DROP TABLE workflow'); + } +}