fix(schema): add missing index administrateurs#groupe_gestionnaire_id
This commit is contained in:
parent
bb4a2b84b9
commit
34788bc800
2 changed files with 16 additions and 0 deletions
|
@ -0,0 +1,15 @@
|
||||||
|
class AddMissingAdministrateursGroupeGestionnaireIndex < ActiveRecord::Migration[7.0]
|
||||||
|
disable_ddl_transaction!
|
||||||
|
|
||||||
|
def up
|
||||||
|
if !index_exists?(:administrateurs, :groupe_gestionnaire_id) # index may have already been added on other environments by a previous migration
|
||||||
|
add_index :administrateurs, :groupe_gestionnaire_id, algorithm: :concurrently
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def down
|
||||||
|
if index_exists?(:administrateurs, :groupe_gestionnaire_id)
|
||||||
|
remove_index :administrateurs, :groupe_gestionnaire_id
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
|
@ -65,6 +65,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_11_14_113317) do
|
||||||
t.bigint "groupe_gestionnaire_id"
|
t.bigint "groupe_gestionnaire_id"
|
||||||
t.datetime "updated_at", precision: nil
|
t.datetime "updated_at", precision: nil
|
||||||
t.bigint "user_id", null: false
|
t.bigint "user_id", null: false
|
||||||
|
t.index ["groupe_gestionnaire_id"], name: "index_administrateurs_on_groupe_gestionnaire_id"
|
||||||
t.index ["user_id"], name: "index_administrateurs_on_user_id"
|
t.index ["user_id"], name: "index_administrateurs_on_user_id"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue