From 8e5571265ff62402a3662ac4073f5516010e8952 Mon Sep 17 00:00:00 2001 From: Justin Edmund Date: Thu, 1 Dec 2022 04:46:24 -0800 Subject: [PATCH] Add job skills to database --- .../20221130155225_add_job_skills_to_party.rb | 9 +++++++++ db/migrate/20221201123645_add_skill0_to_party.rb | 7 +++++++ db/schema.rb | 14 +++++++++++++- 3 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 db/migrate/20221130155225_add_job_skills_to_party.rb create mode 100644 db/migrate/20221201123645_add_skill0_to_party.rb diff --git a/db/migrate/20221130155225_add_job_skills_to_party.rb b/db/migrate/20221130155225_add_job_skills_to_party.rb new file mode 100644 index 0000000..d993378 --- /dev/null +++ b/db/migrate/20221130155225_add_job_skills_to_party.rb @@ -0,0 +1,9 @@ +class AddJobSkillsToParty < ActiveRecord::Migration[6.1] + def change + change_table(:parties) do |t| + t.references :skill1, type: :uuid, foreign_key: { to_table: 'job_skills' } + t.references :skill2, type: :uuid, foreign_key: { to_table: 'job_skills' } + t.references :skill3, type: :uuid, foreign_key: { to_table: 'job_skills' } + end + end +end diff --git a/db/migrate/20221201123645_add_skill0_to_party.rb b/db/migrate/20221201123645_add_skill0_to_party.rb new file mode 100644 index 0000000..f5e66d4 --- /dev/null +++ b/db/migrate/20221201123645_add_skill0_to_party.rb @@ -0,0 +1,7 @@ +class AddSkill0ToParty < ActiveRecord::Migration[6.1] + def change + change_table(:parties) do |t| + t.references :skill0, type: :uuid, foreign_key: { to_table: "job_skills" } + end + end +end diff --git a/db/schema.rb b/db/schema.rb index 748bd82..eed9131 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_11_20_145204) do +ActiveRecord::Schema.define(version: 2022_12_01_123645) do # These are extensions that must be enabled in order to support this database enable_extension "btree_gin" @@ -177,7 +177,15 @@ ActiveRecord::Schema.define(version: 2022_11_20_145204) do t.integer "weapons_count" t.uuid "job_id" t.integer "ml" + t.uuid "skill1_id" + t.uuid "skill2_id" + t.uuid "skill3_id" + t.uuid "skill0_id" t.index ["job_id"], name: "index_parties_on_job_id" + t.index ["skill0_id"], name: "index_parties_on_skill0_id" + t.index ["skill1_id"], name: "index_parties_on_skill1_id" + t.index ["skill2_id"], name: "index_parties_on_skill2_id" + t.index ["skill3_id"], name: "index_parties_on_skill3_id" t.index ["user_id"], name: "index_parties_on_user_id" end @@ -273,6 +281,10 @@ ActiveRecord::Schema.define(version: 2022_11_20_145204) do add_foreign_key "grid_weapons", "weapons" 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" + add_foreign_key "parties", "job_skills", column: "skill1_id" + add_foreign_key "parties", "job_skills", column: "skill2_id" + add_foreign_key "parties", "job_skills", column: "skill3_id" add_foreign_key "parties", "jobs" add_foreign_key "parties", "raids" add_foreign_key "parties", "users"