Add unique index to Experts Procedures on expert <> procedure ids

This commit is contained in:
kara Diaby 2021-01-21 14:57:57 +01:00
parent b39d9d41f0
commit f280820201
2 changed files with 7 additions and 1 deletions

View file

@ -0,0 +1,5 @@
class AddUniqueIndexToExpertsProcedures < ActiveRecord::Migration[6.0]
def change
add_index :experts_procedures, [:expert_id, :procedure_id], unique: true
end
end

View file

@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 2021_01_20_084256) do
ActiveRecord::Schema.define(version: 2021_01_21_134435) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@ -334,6 +334,7 @@ ActiveRecord::Schema.define(version: 2021_01_20_084256) do
t.boolean "allow_decision_access", default: false, null: false
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.index ["expert_id", "procedure_id"], name: "index_experts_procedures_on_expert_id_and_procedure_id", unique: true
t.index ["expert_id"], name: "index_experts_procedures_on_expert_id"
t.index ["procedure_id"], name: "index_experts_procedures_on_procedure_id"
end