Merge pull request #10618 from tchak/db-change-champs-index
chore(champs): replace unique index
This commit is contained in:
commit
860e06256f
3 changed files with 16 additions and 2 deletions
7
db/migrate/20240716075916_add_new_champs_unique_index.rb
Normal file
7
db/migrate/20240716075916_add_new_champs_unique_index.rb
Normal file
|
@ -0,0 +1,7 @@
|
|||
class AddNewChampsUniqueIndex < ActiveRecord::Migration[7.0]
|
||||
disable_ddl_transaction!
|
||||
|
||||
def change
|
||||
add_index :champs, [:dossier_id, :stream, :stable_id, :row_id], unique: true, algorithm: :concurrently
|
||||
end
|
||||
end
|
|
@ -0,0 +1,7 @@
|
|||
class RemoveOldChampsUniqueIndex < ActiveRecord::Migration[7.0]
|
||||
disable_ddl_transaction!
|
||||
|
||||
def change
|
||||
remove_index :champs, [:type_de_champ_id, :dossier_id, :row_id], algorithm: :concurrently
|
||||
end
|
||||
end
|
|
@ -10,7 +10,7 @@
|
|||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema[7.0].define(version: 2024_06_19_205011) do
|
||||
ActiveRecord::Schema[7.0].define(version: 2024_07_16_091043) do
|
||||
# These are extensions that must be enabled in order to support this database
|
||||
enable_extension "pg_buffercache"
|
||||
enable_extension "pg_stat_statements"
|
||||
|
@ -267,13 +267,13 @@ ActiveRecord::Schema[7.0].define(version: 2024_06_19_205011) do
|
|||
t.text "updated_by"
|
||||
t.string "value"
|
||||
t.jsonb "value_json"
|
||||
t.index ["dossier_id", "stream", "stable_id", "row_id"], name: "index_champs_on_dossier_id_and_stream_and_stable_id_and_row_id", unique: true
|
||||
t.index ["dossier_id"], name: "index_champs_on_dossier_id"
|
||||
t.index ["etablissement_id"], name: "index_champs_on_etablissement_id"
|
||||
t.index ["parent_id"], name: "index_champs_on_parent_id"
|
||||
t.index ["row_id"], name: "index_champs_on_row_id"
|
||||
t.index ["stable_id"], name: "index_champs_on_stable_id"
|
||||
t.index ["type"], name: "index_champs_on_type"
|
||||
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
|
||||
|
||||
|
|
Loading…
Reference in a new issue