diff --git a/db/migrate/20210427120002_add_unique_index_to_individuals.rb b/db/migrate/20210427120002_add_unique_index_to_individuals.rb index 39dac52ee..bcfd976d4 100644 --- a/db/migrate/20210427120002_add_unique_index_to_individuals.rb +++ b/db/migrate/20210427120002_add_unique_index_to_individuals.rb @@ -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