db: fix migration adding unique index to Individuals
This commit is contained in:
parent
02902e2b0e
commit
d1777d8cd6
1 changed files with 3 additions and 1 deletions
|
@ -5,10 +5,12 @@ class AddUniqueIndexToIndividuals < ActiveRecord::Migration[6.1]
|
||||||
|
|
||||||
def up
|
def up
|
||||||
delete_duplicates :individuals, [:dossier_id]
|
delete_duplicates :individuals, [:dossier_id]
|
||||||
|
remove_index :individuals, [:dossier_id]
|
||||||
add_concurrent_index :individuals, [:dossier_id], unique: true
|
add_concurrent_index :individuals, [:dossier_id], unique: true
|
||||||
end
|
end
|
||||||
|
|
||||||
def down
|
def down
|
||||||
remove_index :individuals, [:dossier_id]
|
remove_index :individuals, [:dossier_id], unique: true
|
||||||
|
add_concurrent_index :individuals, [:dossier_id]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue