From c211129c970df4efe5245ec845786a817b415d59 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 8 Jul 2026 10:17:04 +0200 Subject: [PATCH] Migrations file --- migrations/Version20260708081610.php | 36 ++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 migrations/Version20260708081610.php diff --git a/migrations/Version20260708081610.php b/migrations/Version20260708081610.php new file mode 100644 index 0000000..f37f050 --- /dev/null +++ b/migrations/Version20260708081610.php @@ -0,0 +1,36 @@ +addSql('DROP INDEX unique_quartal'); + $this->addSql('ALTER TABLE contacts ALTER ambulance TYPE VARCHAR(100)'); + $this->addSql('CREATE UNIQUE INDEX unique_quartal ON contacts (phone_number, due_quartal) WHERE due_quartal IS NOT NULL'); + } + + public function down(Schema $schema): void + { + // this down() migration is auto-generated, please modify it to your needs + $this->addSql('CREATE SCHEMA public'); + $this->addSql('DROP INDEX unique_quartal'); + $this->addSql('ALTER TABLE contacts ALTER ambulance TYPE VARCHAR(50)'); + $this->addSql('CREATE UNIQUE INDEX unique_quartal ON contacts (phone_number, due_quartal) WHERE (due_quartal IS NOT NULL)'); + } +}