From 6579bb72dd29f554603c5286f72f19dd7862fae1 Mon Sep 17 00:00:00 2001 From: tristan Date: Wed, 29 Apr 2026 09:31:56 +0200 Subject: [PATCH] feat : migration entry_completed + bovine.reception_id Co-Authored-By: Claude Opus 4.7 (1M context) --- migrations/Version20260429073108.php | 35 ++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 migrations/Version20260429073108.php diff --git a/migrations/Version20260429073108.php b/migrations/Version20260429073108.php new file mode 100644 index 0000000..946a6ed --- /dev/null +++ b/migrations/Version20260429073108.php @@ -0,0 +1,35 @@ +addSql('ALTER TABLE reception ADD entry_completed BOOLEAN NOT NULL DEFAULT FALSE'); + + // Bovine : FK nullable vers la réception qui a fait entrer le bovin. + $this->addSql('ALTER TABLE bovine ADD reception_id INT DEFAULT NULL'); + $this->addSql('CREATE INDEX IDX_BOVINE_RECEPTION ON bovine (reception_id)'); + $this->addSql('ALTER TABLE bovine ADD CONSTRAINT FK_BOVINE_RECEPTION FOREIGN KEY (reception_id) REFERENCES reception (id) ON DELETE SET NULL'); + } + + public function down(Schema $schema): void + { + $this->addSql('ALTER TABLE bovine DROP CONSTRAINT FK_BOVINE_RECEPTION'); + $this->addSql('DROP INDEX IDX_BOVINE_RECEPTION'); + $this->addSql('ALTER TABLE bovine DROP reception_id'); + $this->addSql('ALTER TABLE reception DROP entry_completed'); + } +}