From f542c0876e92c7a44287921f064334f355b12ef6 Mon Sep 17 00:00:00 2001 From: simon lehericey Date: Fri, 16 Apr 2021 18:11:55 +0200 Subject: [PATCH] Add missing etablissement_id index on exercices table (-600ms) --- .../20210416160721_add_index_to_exercice_etablissement_id.rb | 5 +++++ db/schema.rb | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 db/migrate/20210416160721_add_index_to_exercice_etablissement_id.rb diff --git a/db/migrate/20210416160721_add_index_to_exercice_etablissement_id.rb b/db/migrate/20210416160721_add_index_to_exercice_etablissement_id.rb new file mode 100644 index 000000000..724a98979 --- /dev/null +++ b/db/migrate/20210416160721_add_index_to_exercice_etablissement_id.rb @@ -0,0 +1,5 @@ +class AddIndexToExerciceEtablissementId < ActiveRecord::Migration[6.1] + def change + add_index :exercices, :etablissement_id + end +end diff --git a/db/schema.rb b/db/schema.rb index d74b65981..c282337f9 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: 2021_04_16_074049) do +ActiveRecord::Schema.define(version: 2021_04_16_160721) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -325,6 +325,7 @@ ActiveRecord::Schema.define(version: 2021_04_16_074049) do t.datetime "date_fin_exercice" t.datetime "created_at" t.datetime "updated_at" + t.index ["etablissement_id"], name: "index_exercices_on_etablissement_id" end create_table "experts", force: :cascade do |t|