diff --git a/db/migrate/20230207105539_add_external_id_index_to_champs.rb b/db/migrate/20230207105539_add_external_id_index_to_champs.rb new file mode 100644 index 000000000..058bf31d9 --- /dev/null +++ b/db/migrate/20230207105539_add_external_id_index_to_champs.rb @@ -0,0 +1,13 @@ +class AddExternalIdIndexToChamps < ActiveRecord::Migration[6.1] + include Database::MigrationHelpers + + disable_ddl_transaction! + + def up + add_concurrent_index :champs, :external_id + end + + def down + remove_index :champs, column: :external_id + end +end diff --git a/db/schema.rb b/db/schema.rb index d465805de..59abcc837 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 2023_02_03_134127) do +ActiveRecord::Schema.define(version: 2023_02_07_105539) do # These are extensions that must be enabled in order to support this database enable_extension "pgcrypto" @@ -233,6 +233,7 @@ ActiveRecord::Schema.define(version: 2023_02_03_134127) do t.jsonb "value_json" t.index ["dossier_id"], name: "index_champs_on_dossier_id" t.index ["etablissement_id"], name: "index_champs_on_etablissement_id" + t.index ["external_id"], name: "index_champs_on_external_id" t.index ["parent_id"], name: "index_champs_on_parent_id" t.index ["private"], name: "index_champs_on_private" t.index ["row_id"], name: "index_champs_on_row_id"