From 03f3c85fd899c4b54fc2fe62f93a9c9d0e2a838a Mon Sep 17 00:00:00 2001 From: matthieu Date: Tue, 19 May 2026 19:51:07 +0200 Subject: [PATCH] =?UTF-8?q?feat(workflow)=20:=20migration=20M1=20-=20cr?= =?UTF-8?q?=C3=A9ation=20table=20workflow=20+=20seed=20Standard?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- migrations/Version20260519175041.php | 36 ++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 migrations/Version20260519175041.php 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'); + } +}