From b1c69301214cabbc27ed1f76a9f1616666a1c702 Mon Sep 17 00:00:00 2001 From: Justin Edmund Date: Sat, 3 Dec 2022 11:43:27 -0800 Subject: [PATCH] Add base_job so we can track base skills --- db/migrate/20221203112452_add_base_job_to_jobs.rb | 7 +++++++ db/schema.rb | 5 ++++- 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 db/migrate/20221203112452_add_base_job_to_jobs.rb diff --git a/db/migrate/20221203112452_add_base_job_to_jobs.rb b/db/migrate/20221203112452_add_base_job_to_jobs.rb new file mode 100644 index 0000000..e689758 --- /dev/null +++ b/db/migrate/20221203112452_add_base_job_to_jobs.rb @@ -0,0 +1,7 @@ +class AddBaseJobToJobs < ActiveRecord::Migration[6.1] + def change + change_table(:jobs) do |t| + t.references :base_job, type: :uuid, foreign_key: { to_table: 'jobs' } + end + end +end diff --git a/db/schema.rb b/db/schema.rb index eed9131..52d1af4 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_12_01_123645) do +ActiveRecord::Schema.define(version: 2022_12_03_112452) do # These are extensions that must be enabled in order to support this database enable_extension "btree_gin" @@ -124,6 +124,8 @@ ActiveRecord::Schema.define(version: 2022_12_01_123645) do t.string "row" t.boolean "ml", default: false t.integer "order" + t.uuid "base_job_id" + t.index ["base_job_id"], name: "index_jobs_on_base_job_id" end create_table "oauth_access_grants", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| @@ -279,6 +281,7 @@ ActiveRecord::Schema.define(version: 2022_12_01_123645) do add_foreign_key "grid_weapons", "parties" add_foreign_key "grid_weapons", "weapon_keys", column: "weapon_key3_id" add_foreign_key "grid_weapons", "weapons" + add_foreign_key "jobs", "jobs", column: "base_job_id" add_foreign_key "oauth_access_grants", "oauth_applications", column: "application_id" add_foreign_key "oauth_access_tokens", "oauth_applications", column: "application_id" add_foreign_key "parties", "job_skills", column: "skill0_id"