Skip to content

Commit

Permalink
Merge pull request #1631 from NASA-AMMOS/fix/before-delete-return-old
Browse files Browse the repository at this point in the history
Fix "before delete" trigger on Scheduling Specification Conditions
  • Loading branch information
Mythicaeda authored Jan 29, 2025
2 parents ab573c3 + 294d992 commit 1388d24
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
create or replace function scheduler.increment_spec_revision_on_conditions_spec_delete()
returns trigger
security definer
language plpgsql as $$
begin
update scheduler.scheduling_specification
set revision = revision + 1
where id = new.specification_id;
return new;
end;
$$;
call migrations.mark_migration_rolled_back('13');
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
create or replace function scheduler.increment_spec_revision_on_conditions_spec_delete()
returns trigger
security definer
language plpgsql as $$
begin
update scheduler.scheduling_specification
set revision = revision + 1
where id = new.specification_id;
return old;
end;
$$;
call migrations.mark_migration_applied('13');
1 change: 1 addition & 0 deletions deployment/postgres-init-db/sql/applied_migrations.sql
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ call migrations.mark_migration_applied('9');
call migrations.mark_migration_applied('10');
call migrations.mark_migration_applied('11');
call migrations.mark_migration_applied('12');
call migrations.mark_migration_applied('13');
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ begin
update scheduler.scheduling_specification
set revision = revision + 1
where id = new.specification_id;
return new;
return old;
end;
$$;

Expand Down

0 comments on commit 1388d24

Please sign in to comment.