-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Set null columns to the default value prior to setting not null
- Loading branch information
1 parent
42536fa
commit 358ad5a
Showing
1 changed file
with
10 additions
and
2 deletions.
There are no files selected for viewing
12 changes: 10 additions & 2 deletions
12
deployment/hasura/migrations/AerieScheduler/7_definition_consistency/up.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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'); |