Remove old index after executing a query in stages migration

This makes it possible to heavily optimize this migration, because we
need an outdated index to remove redundant stages faster.
This commit is contained in:
Grzegorz Bizon 2018-02-07 09:18:11 +01:00
parent c30f442174
commit adb6dd0670
1 changed files with 1 additions and 1 deletions

View File

@ -6,8 +6,8 @@ class RemoveRedundantPipelineStages < ActiveRecord::Migration
disable_ddl_transaction!
def up(attempts: 100)
remove_outdated_index!
remove_redundant_pipeline_stages!
remove_outdated_index!
add_unique_index!
rescue ActiveRecord::RecordNotUnique
retry if (attempts -= 1) > 0