db(migration): add procedure_id to bulk_messages

This commit is contained in:
Eric Leroy-Terquem 2024-02-27 18:01:43 +01:00
parent efa19926e4
commit 1f0e2030be
3 changed files with 8 additions and 1 deletions

View file

@ -1,4 +1,5 @@
class BulkMessage < ApplicationRecord class BulkMessage < ApplicationRecord
belongs_to :instructeur belongs_to :instructeur
belongs_to :procedure
has_and_belongs_to_many :groupe_instructeurs, -> { order(:label) } has_and_belongs_to_many :groupe_instructeurs, -> { order(:label) }
end end

View file

@ -0,0 +1,5 @@
class AddProcedureIdToBulkMessages < ActiveRecord::Migration[7.0]
def change
add_column :bulk_messages, :procedure_id, :bigint
end
end

View file

@ -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[7.0].define(version: 2024_02_15_164247) do ActiveRecord::Schema[7.0].define(version: 2024_02_27_163855) 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 "pgcrypto" enable_extension "pgcrypto"
enable_extension "plpgsql" enable_extension "plpgsql"
@ -224,6 +224,7 @@ ActiveRecord::Schema[7.0].define(version: 2024_02_15_164247) do
t.string "dossier_state" t.string "dossier_state"
t.bigint "instructeur_id", null: false t.bigint "instructeur_id", null: false
t.datetime "sent_at", precision: nil, null: false t.datetime "sent_at", precision: nil, null: false
t.bigint "procedure_id"
t.datetime "updated_at", null: false t.datetime "updated_at", null: false
end end