From bc5e46e6de2a6a72024cc3361f49e063b4985e6f Mon Sep 17 00:00:00 2001 From: Paul Chavard Date: Fri, 7 Oct 2022 15:17:31 +0200 Subject: [PATCH] chore(db): add index on type to champs --- db/migrate/20221006134215_add_index_on_type_to_champs.rb | 7 +++++++ db/schema.rb | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 db/migrate/20221006134215_add_index_on_type_to_champs.rb diff --git a/db/migrate/20221006134215_add_index_on_type_to_champs.rb b/db/migrate/20221006134215_add_index_on_type_to_champs.rb new file mode 100644 index 000000000..f3a2240b8 --- /dev/null +++ b/db/migrate/20221006134215_add_index_on_type_to_champs.rb @@ -0,0 +1,7 @@ +class AddIndexOnTypeToChamps < ActiveRecord::Migration[6.1] + include Database::MigrationHelpers + disable_ddl_transaction! + def up + add_concurrent_index :champs, [:type] + end +end diff --git a/db/schema.rb b/db/schema.rb index 1374cdb79..b99bfb8eb 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: 2022_10_06_193737) do +ActiveRecord::Schema.define(version: 2022_10_07_113737) do # These are extensions that must be enabled in order to support this database enable_extension "pgcrypto" @@ -203,6 +203,7 @@ ActiveRecord::Schema.define(version: 2022_10_06_193737) do t.index ["parent_id"], name: "index_champs_on_parent_id" t.index ["private"], name: "index_champs_on_private" t.index ["row"], name: "index_champs_on_row" + 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"], name: "index_champs_on_type_de_champ_id" end