From 358ad5a488f9b1d8a335ccbd046582b2372fb3f3 Mon Sep 17 00:00:00 2001 From: Theresa Kamerman Date: Thu, 28 Sep 2023 09:46:33 -0700 Subject: [PATCH] Set null columns to the default value prior to setting not null --- .../AerieScheduler/7_definition_consistency/up.sql | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/deployment/hasura/migrations/AerieScheduler/7_definition_consistency/up.sql b/deployment/hasura/migrations/AerieScheduler/7_definition_consistency/up.sql index 08d021d915..871994f93c 100644 --- a/deployment/hasura/migrations/AerieScheduler/7_definition_consistency/up.sql +++ b/deployment/hasura/migrations/AerieScheduler/7_definition_consistency/up.sql @@ -1,9 +1,17 @@ alter table scheduling_goal - alter column description set default '', + alter column description set default ''; +update scheduling_goal + set description = default + where description is null; +alter table scheduling_goal alter column description set not null; alter table scheduling_condition - alter column description set default '', + alter column description set default ''; +update scheduling_condition + set description = default + where description is null; +alter table scheduling_condition alter column description set not null; call migrations.mark_migration_applied('7');