db: fix migration to drop ai_tags.tag_id index concurrently.

Fix deadlock in production when trying to drop this index.
This commit is contained in:
evazion
2022-08-21 20:07:39 -05:00
parent 9c2d362e93
commit 8ed2c4f0b6

View File

@@ -1,6 +1,8 @@
class AddTagIdAndScoreIndexToAITags < ActiveRecord::Migration[7.0]
disable_ddl_transaction!
def change
add_index :ai_tags, [:tag_id, :score], if_not_exists: true
remove_index :ai_tags, :tag_id
remove_index :ai_tags, :tag_id, algorithm: :concurrently, if_exists: true
end
end