From 85ea1ac3feb6e0d23006ddde1b2f1e1c46d4e933 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 8 Jul 2026 09:17:44 +0200 Subject: [PATCH] Created migration for latest entity changes --- migrations/Version20260708071521.php | 38 ++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 migrations/Version20260708071521.php diff --git a/migrations/Version20260708071521.php b/migrations/Version20260708071521.php new file mode 100644 index 0000000..6724afb --- /dev/null +++ b/migrations/Version20260708071521.php @@ -0,0 +1,38 @@ +addSql('DROP INDEX unique_quartal'); + $this->addSql('ALTER TABLE contacts ADD ambu_code VARCHAR(20) DEFAULT NULL'); + $this->addSql('ALTER TABLE contacts ADD ambulance VARCHAR(50) DEFAULT NULL'); + $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 DROP ambu_code'); + $this->addSql('ALTER TABLE contacts DROP ambulance'); + $this->addSql('CREATE UNIQUE INDEX unique_quartal ON contacts (phone_number, due_quartal) WHERE (due_quartal IS NOT NULL)'); + } +}