Skip to content

Commit

Permalink
Merge pull request #960 from NASA-AMMOS/fix/make-constraints-descript…
Browse files Browse the repository at this point in the history
…ion-optional

Make `Description` optional across the DB
  • Loading branch information
Mythicaeda authored May 31, 2023
2 parents a5ceee8 + 38cb0d8 commit 01c436c
Show file tree
Hide file tree
Showing 10 changed files with 38 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
alter table public.simulation_template
alter column description drop default;

alter table public."constraint"
alter column description drop default;

call migrations.mark_migration_rolled_back('15');
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
alter table public."constraint"
alter column description set default '';

alter table public.simulation_template
alter column description set default '';

call migrations.mark_migration_applied('15');
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
alter table scheduling_condition
alter column description drop default,
alter column description drop not null;

alter table scheduling_goal
alter column description drop default,
alter column description drop not null;

call migrations.mark_migration_rolled_back('7');
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
alter table scheduling_goal
alter column description set default '',
alter column description set not null;

alter table scheduling_condition
alter column description set default '',
alter column description set not null;

call migrations.mark_migration_applied('7');
1 change: 1 addition & 0 deletions merlin-server/sql/merlin/applied_migrations.sql
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ call migrations.mark_migration_applied('11');
call migrations.mark_migration_applied('12');
call migrations.mark_migration_applied('13');
call migrations.mark_migration_applied('14');
call migrations.mark_migration_applied('15');
2 changes: 1 addition & 1 deletion merlin-server/sql/merlin/tables/constraint.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ create table "constraint" (
id integer generated always as identity,

name text not null,
description text not null,
description text not null default '',
definition text not null,
tags text[] default '{}',

Expand Down
2 changes: 1 addition & 1 deletion merlin-server/sql/merlin/tables/simulation_template.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ create table simulation_template (
revision integer not null default 0,

model_id integer not null,
description text not null,
description text not null default '',
arguments merlin_argument_set not null,
owner text not null default '',

Expand Down
1 change: 1 addition & 0 deletions scheduler-server/sql/scheduler/applied_migrations.sql
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ call migrations.mark_migration_applied('3');
call migrations.mark_migration_applied('4');
call migrations.mark_migration_applied('5');
call migrations.mark_migration_applied('6');
call migrations.mark_migration_applied('7');
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ create table scheduling_condition (
definition text not null,

model_id integer not null,
description text null,
description text not null default '',
author text null,
last_modified_by text null,
created_date timestamptz not null default now(),
Expand Down
2 changes: 1 addition & 1 deletion scheduler-server/sql/scheduler/tables/scheduling_goal.sql
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ create table scheduling_goal (
tags text[] not null default '{}',

model_id integer not null,
description text null,
description text not null default '',
author text null,
last_modified_by text null,
created_date timestamptz not null default now(),
Expand Down

0 comments on commit 01c436c

Please sign in to comment.