db: fix migration adding unique index to Individuals

This commit is contained in:
Pierre de La Morinerie 2021-04-27 16:57:46 +02:00
parent 02902e2b0e
commit d1777d8cd6

View file

@ -5,10 +5,12 @@ class AddUniqueIndexToIndividuals < ActiveRecord::Migration[6.1]
def up
delete_duplicates :individuals, [:dossier_id]
remove_index :individuals, [:dossier_id]
add_concurrent_index :individuals, [:dossier_id], unique: true
end
def down
remove_index :individuals, [:dossier_id]
remove_index :individuals, [:dossier_id], unique: true
add_concurrent_index :individuals, [:dossier_id]
end
end