add belongs_to zone for procedure

This commit is contained in:
Christophe Robillard 2021-12-01 21:05:15 +01:00
parent 5b8d872b6e
commit 561f6fb274
4 changed files with 12 additions and 1 deletions

View file

@ -0,0 +1,5 @@
class AddZoneToProcedures < ActiveRecord::Migration[6.1]
def change
add_reference :procedures, :zone, null: true, foreign_key: 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_11_27_133549) do
ActiveRecord::Schema.define(version: 2021_11_27_143736) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@ -638,6 +638,7 @@ ActiveRecord::Schema.define(version: 2021_11_27_133549) do
t.text "api_particulier_scopes", default: [], array: true
t.jsonb "api_particulier_sources", default: {}
t.boolean "instructeurs_self_management_enabled"
t.bigint "zone_id"
t.index ["api_particulier_sources"], name: "index_procedures_on_api_particulier_sources", using: :gin
t.boolean "routing_enabled"
t.index ["declarative_with_state"], name: "index_procedures_on_declarative_with_state"
@ -648,6 +649,7 @@ ActiveRecord::Schema.define(version: 2021_11_27_133549) do
t.index ["path", "closed_at", "hidden_at"], name: "index_procedures_on_path_and_closed_at_and_hidden_at", unique: true
t.index ["published_revision_id"], name: "index_procedures_on_published_revision_id"
t.index ["service_id"], name: "index_procedures_on_service_id"
t.index ["zone_id"], name: "index_procedures_on_zone_id"
end
create_table "received_mails", id: :serial, force: :cascade do |t|
@ -865,6 +867,7 @@ ActiveRecord::Schema.define(version: 2021_11_27_133549) do
add_foreign_key "procedures", "procedure_revisions", column: "draft_revision_id"
add_foreign_key "procedures", "procedure_revisions", column: "published_revision_id"
add_foreign_key "procedures", "services"
add_foreign_key "procedures", "zones"
add_foreign_key "received_mails", "procedures"
add_foreign_key "refused_mails", "procedures"
add_foreign_key "services", "administrateurs"