diff --git a/deployment/merge_aerie_db/merge_db/migrate_scheduler_triggers.sql b/deployment/merge_aerie_db/merge_db/migrate_scheduler_triggers.sql index 551e5e655e..94323d7c3b 100644 --- a/deployment/merge_aerie_db/merge_db/migrate_scheduler_triggers.sql +++ b/deployment/merge_aerie_db/merge_db/migrate_scheduler_triggers.sql @@ -38,7 +38,8 @@ begin insert into scheduler.scheduling_specification_goals (specification_id, goal_id, goal_revision, priority) select spec_id, msg.goal_id, msg.goal_revision, msg.priority from scheduler.scheduling_model_specification_goals msg - where msg.model_id = new.model_id; + where msg.model_id = new.model_id + order by msg.priority; insert into scheduler.scheduling_specification_conditions (specification_id, condition_id, condition_revision) select spec_id, msc.condition_id, msc.condition_revision diff --git a/deployment/postgres-init-db/sql/tables/scheduler/scheduling_specification/scheduling_specification.sql b/deployment/postgres-init-db/sql/tables/scheduler/scheduling_specification/scheduling_specification.sql index f84078cfff..c402c21fee 100644 --- a/deployment/postgres-init-db/sql/tables/scheduler/scheduling_specification/scheduling_specification.sql +++ b/deployment/postgres-init-db/sql/tables/scheduler/scheduling_specification/scheduling_specification.sql @@ -53,7 +53,8 @@ begin insert into scheduler.scheduling_specification_goals (specification_id, goal_id, goal_revision, priority) select spec_id, msg.goal_id, msg.goal_revision, msg.priority from scheduler.scheduling_model_specification_goals msg - where msg.model_id = new.model_id; + where msg.model_id = new.model_id + order by msg.priority; insert into scheduler.scheduling_specification_conditions (specification_id, condition_id, condition_revision) select spec_id, msc.condition_id, msc.condition_revision