From dc15b39648c94c7fb77f816427b3f6c95e287df0 Mon Sep 17 00:00:00 2001 From: Christophe Robillard Date: Thu, 11 Aug 2022 19:04:54 +0200 Subject: [PATCH] add zone_label migration --- db/migrate/20220911134914_create_zone_labels.rb | 11 +++++++++++ db/schema.rb | 12 +++++++++++- 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 db/migrate/20220911134914_create_zone_labels.rb diff --git a/db/migrate/20220911134914_create_zone_labels.rb b/db/migrate/20220911134914_create_zone_labels.rb new file mode 100644 index 000000000..5f56cfc96 --- /dev/null +++ b/db/migrate/20220911134914_create_zone_labels.rb @@ -0,0 +1,11 @@ +class CreateZoneLabels < ActiveRecord::Migration[6.1] + def change + create_table :zone_labels do |t| + t.belongs_to :zone, null: false, foreign_key: true + t.date :designated_on, null: false + t.string :name, null: false + + t.timestamps + end + end +end diff --git a/db/schema.rb b/db/schema.rb index 33115f0cd..a60142a8c 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 2022_09_02_151920) do +ActiveRecord::Schema.define(version: 2022_09_11_134914) do # These are extensions that must be enabled in order to support this database enable_extension "pgcrypto" @@ -861,6 +861,15 @@ ActiveRecord::Schema.define(version: 2022_09_02_151920) do t.index ["procedure_id"], name: "index_without_continuation_mails_on_procedure_id" end + create_table "zone_labels", force: :cascade do |t| + t.datetime "created_at", precision: 6, null: false + t.date "designated_on", null: false + t.string "name", null: false + t.datetime "updated_at", precision: 6, null: false + t.bigint "zone_id", null: false + t.index ["zone_id"], name: "index_zone_labels_on_zone_id" + end + create_table "zones", force: :cascade do |t| t.string "acronym", null: false t.datetime "created_at", precision: 6, null: false @@ -922,4 +931,5 @@ ActiveRecord::Schema.define(version: 2022_09_02_151920) do add_foreign_key "trusted_device_tokens", "instructeurs" add_foreign_key "users", "users", column: "requested_merge_into_id" add_foreign_key "without_continuation_mails", "procedures" + add_foreign_key "zone_labels", "zones" end