From f2edc1ef0cad3a2f89e206e0195f8c285063ad9f Mon Sep 17 00:00:00 2001 From: nobohan Date: Thu, 10 Mar 2022 14:23:00 +0100 Subject: [PATCH] set constrint ondelete for comment in AccompanyingPeriod --- .../migrations/Version20220310124318.php | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 src/Bundle/ChillPersonBundle/migrations/Version20220310124318.php diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20220310124318.php b/src/Bundle/ChillPersonBundle/migrations/Version20220310124318.php new file mode 100644 index 000000000..6b58b24a3 --- /dev/null +++ b/src/Bundle/ChillPersonBundle/migrations/Version20220310124318.php @@ -0,0 +1,38 @@ +addSql('ALTER TABLE chill_person_accompanying_period DROP CONSTRAINT fk_e260a868b0804e90'); + $this->addSql('ALTER TABLE chill_person_accompanying_period ADD CONSTRAINT fk_e260a868b0804e90 FOREIGN KEY (pinnedcomment_id) REFERENCES chill_person_accompanying_period_comment (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); + } + + public function getDescription(): string + { + return 'Change constraint on pinnedComment in Accompanying period'; + } + + public function up(Schema $schema): void + { + $this->addSql('ALTER TABLE chill_person_accompanying_period DROP CONSTRAINT FK_E260A868B0804E90'); + $this->addSql('ALTER TABLE chill_person_accompanying_period ADD CONSTRAINT FK_E260A868B0804E90 FOREIGN KEY (pinnedComment_id) REFERENCES chill_person_accompanying_period_comment (id) ON DELETE SET NULL NOT DEFERRABLE INITIALLY IMMEDIATE'); + } +}