From 7fb0e443075d6823add27da2b304499eba3b25a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Sat, 28 May 2022 01:45:11 +0200 Subject: [PATCH] fix null value for calendar in private comments --- .../migrations/Version20220527234046.php | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 src/Bundle/ChillCalendarBundle/migrations/Version20220527234046.php diff --git a/src/Bundle/ChillCalendarBundle/migrations/Version20220527234046.php b/src/Bundle/ChillCalendarBundle/migrations/Version20220527234046.php new file mode 100644 index 000000000..c53f82661 --- /dev/null +++ b/src/Bundle/ChillCalendarBundle/migrations/Version20220527234046.php @@ -0,0 +1,30 @@ +addSql('UPDATE chill_calendar.calendar SET privateComment_comments=\'{}\' WHERE privateComment_comments IS NULL'); + $this->addSql('ALTER TABLE chill_calendar.calendar ALTER COLUMN privateComment_comments SET NOT NULL'); + $this->addSql('ALTER TABLE chill_calendar.calendar ALTER COLUMN privateComment_comments SET DEFAULT \'{}\''); + + } + + public function down(Schema $schema): void + { + $this->addSql('ALTER TABLE chill_calendar.calendar ALTER COLUMN privateComment_comments DROP NOT NULL'); + $this->addSql('ALTER TABLE chill_calendar.calendar ALTER COLUMN privateComment_comments SET DEFAULT NULL'); + } +}