add unique index on bulk messages join table
This commit is contained in:
parent
69393c2921
commit
b6f931a968
3 changed files with 12 additions and 4 deletions
|
@ -10,7 +10,9 @@
|
||||||
.procedure-header
|
.procedure-header
|
||||||
%h1= procedure_libelle @procedure
|
%h1= procedure_libelle @procedure
|
||||||
= link_to 'gestion des notifications', email_notifications_instructeur_procedure_path(@procedure), class: 'header-link'
|
= link_to 'gestion des notifications', email_notifications_instructeur_procedure_path(@procedure), class: 'header-link'
|
||||||
|
|
|
||||||
|
- if @procedure.dossiers.state_brouillon.where(groupe_instructeur: current_instructeur.groupe_instructeur_ids).includes(:groupe_instructeur).present?
|
||||||
|
|
||||||
= link_to 'contacter les usagers en brouillon', email_usagers_instructeur_procedure_path(@procedure), class: 'header-link'
|
= link_to 'contacter les usagers en brouillon', email_usagers_instructeur_procedure_path(@procedure), class: 'header-link'
|
||||||
|
|
|
|
||||||
= link_to 'statistiques', stats_instructeur_procedure_path(@procedure), class: 'header-link'
|
= link_to 'statistiques', stats_instructeur_procedure_path(@procedure), class: 'header-link'
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
class AddUniqueIndexToBulkMessagesGroupeInstructeurs < ActiveRecord::Migration[6.1]
|
||||||
|
def change
|
||||||
|
add_index :bulk_messages_groupe_instructeurs, [:bulk_message_id, :groupe_instructeur_id], unique: true, name: :index_bulk_msg_gi_on_bulk_msg_id_and_gi_id
|
||||||
|
end
|
||||||
|
end
|
|
@ -10,7 +10,7 @@
|
||||||
#
|
#
|
||||||
# It's strongly recommended that you check this file into your version control system.
|
# It's strongly recommended that you check this file into your version control system.
|
||||||
|
|
||||||
ActiveRecord::Schema.define(version: 2021_07_22_133553) do
|
ActiveRecord::Schema.define(version: 2021_07_27_172504) do
|
||||||
|
|
||||||
# These are extensions that must be enabled in order to support this database
|
# These are extensions that must be enabled in order to support this database
|
||||||
enable_extension "plpgsql"
|
enable_extension "plpgsql"
|
||||||
|
@ -169,6 +169,7 @@ ActiveRecord::Schema.define(version: 2021_07_22_133553) do
|
||||||
create_table "bulk_messages_groupe_instructeurs", id: false, force: :cascade do |t|
|
create_table "bulk_messages_groupe_instructeurs", id: false, force: :cascade do |t|
|
||||||
t.bigint "bulk_message_id"
|
t.bigint "bulk_message_id"
|
||||||
t.bigint "groupe_instructeur_id"
|
t.bigint "groupe_instructeur_id"
|
||||||
|
t.index ["bulk_message_id", "groupe_instructeur_id"], name: "index_bulk_msg_gi_on_bulk_msg_id_and_gi_id", unique: true
|
||||||
t.index ["bulk_message_id"], name: "index_bulk_messages_groupe_instructeurs_on_bulk_message_id"
|
t.index ["bulk_message_id"], name: "index_bulk_messages_groupe_instructeurs_on_bulk_message_id"
|
||||||
t.index ["groupe_instructeur_id"], name: "index_bulk_messages_groupe_instructeurs_on_gi_id"
|
t.index ["groupe_instructeur_id"], name: "index_bulk_messages_groupe_instructeurs_on_gi_id"
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue