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'); + } +}