db: porting down migration improvements
We made some improvements to the down migration for dropping build event
ids in the 7.4.x release
so I'm just porting
over these improvements to the master branch.
@@ -4,7 +4,7 @@ declare
startValue int;
begin
for b in
- select id, name, pipeline_id, team_id from builds where status = 'started' and completed = false and aborted = false
+ select id, name, pipeline_id, team_id from builds where (status = 'started' OR status = 'pending') and completed = false
loop
raise notice 'dropping sequence build_event_id_seq_% ...', b.id;
execute 'drop sequence if exists build_event_id_seq_' || b.id;
