refactor(repetition): use row_id instead of row

This commit is contained in:
Paul Chavard 2022-12-16 15:07:26 +01:00
parent 8adada9857
commit af33d5d65c
17 changed files with 47 additions and 36 deletions

View file

@ -0,0 +1,5 @@
class RemoveChampsRowIndex < ActiveRecord::Migration[6.1]
def change
remove_index :champs, name: "index_champs_on_type_de_champ_id_and_dossier_id_and_row"
end
end

View file

@ -0,0 +1,7 @@
class AddChampsRowIdIndex < ActiveRecord::Migration[6.1]
disable_ddl_transaction!
def change
add_index :champs, [:type_de_champ_id, :dossier_id, :row_id], unique: true, algorithm: :concurrently
end
end

View file

@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 2023_01_09_140138) do
ActiveRecord::Schema.define(version: 2023_01_10_181426) do
# These are extensions that must be enabled in order to support this database
enable_extension "pgcrypto"
@ -240,7 +240,7 @@ ActiveRecord::Schema.define(version: 2023_01_09_140138) do
t.index ["row"], name: "index_champs_on_row"
t.index ["row_id"], name: "index_champs_on_row_id"
t.index ["type"], name: "index_champs_on_type"
t.index ["type_de_champ_id", "dossier_id", "row"], name: "index_champs_on_type_de_champ_id_and_dossier_id_and_row", unique: true
t.index ["type_de_champ_id", "dossier_id", "row_id"], name: "index_champs_on_type_de_champ_id_and_dossier_id_and_row_id", unique: true
t.index ["type_de_champ_id"], name: "index_champs_on_type_de_champ_id"
end