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:
parent
c30f442174
commit
adb6dd0670
1 changed files with 1 additions and 1 deletions
|
@ -6,8 +6,8 @@ class RemoveRedundantPipelineStages < ActiveRecord::Migration
|
||||||
disable_ddl_transaction!
|
disable_ddl_transaction!
|
||||||
|
|
||||||
def up(attempts: 100)
|
def up(attempts: 100)
|
||||||
remove_outdated_index!
|
|
||||||
remove_redundant_pipeline_stages!
|
remove_redundant_pipeline_stages!
|
||||||
|
remove_outdated_index!
|
||||||
add_unique_index!
|
add_unique_index!
|
||||||
rescue ActiveRecord::RecordNotUnique
|
rescue ActiveRecord::RecordNotUnique
|
||||||
retry if (attempts -= 1) > 0
|
retry if (attempts -= 1) > 0
|
||||||
|
|
Loading…
Reference in a new issue