From ae99019f641b98e3a6ec199e3684d6fa635ae11a Mon Sep 17 00:00:00 2001 From: Justin Edmund Date: Tue, 22 Mar 2022 02:55:56 -0700 Subject: [PATCH] Rename classes to jobs because reserved words --- .../20220322095311_change_classes_to_jobs.rb | 5 ++++ ...0220322095436_rename_class_id_to_job_id.rb | 5 ++++ db/schema.rb | 26 +++++++++---------- 3 files changed, 23 insertions(+), 13 deletions(-) create mode 100644 db/migrate/20220322095311_change_classes_to_jobs.rb create mode 100644 db/migrate/20220322095436_rename_class_id_to_job_id.rb diff --git a/db/migrate/20220322095311_change_classes_to_jobs.rb b/db/migrate/20220322095311_change_classes_to_jobs.rb new file mode 100644 index 0000000..2598325 --- /dev/null +++ b/db/migrate/20220322095311_change_classes_to_jobs.rb @@ -0,0 +1,5 @@ +class ChangeClassesToJobs < ActiveRecord::Migration[6.1] + def change + rename_table :classes, :jobs + end +end diff --git a/db/migrate/20220322095436_rename_class_id_to_job_id.rb b/db/migrate/20220322095436_rename_class_id_to_job_id.rb new file mode 100644 index 0000000..4da342a --- /dev/null +++ b/db/migrate/20220322095436_rename_class_id_to_job_id.rb @@ -0,0 +1,5 @@ +class RenameClassIdToJobId < ActiveRecord::Migration[6.1] + def change + rename_column :parties, :class_id, :job_id + end +end diff --git a/db/schema.rb b/db/schema.rb index 77765a6..87c38b3 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_03_22_092821) do +ActiveRecord::Schema.define(version: 2022_03_22_095436) do # These are extensions that must be enabled in order to support this database enable_extension "btree_gin" @@ -47,15 +47,6 @@ ActiveRecord::Schema.define(version: 2022_03_22_092821) do t.index ["name_en"], name: "index_characters_on_name_en", opclass: :gin_trgm_ops, using: :gin end - create_table "classes", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| - t.string "name_en" - t.string "name_jp" - t.integer "proficiency1" - t.integer "proficiency2" - t.string "row" - t.boolean "ml", default: false - end - create_table "favorites", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.uuid "user_id" t.uuid "party_id" @@ -110,6 +101,15 @@ ActiveRecord::Schema.define(version: 2022_03_22_092821) do t.index ["weapon_id"], name: "index_grid_weapons_on_weapon_id" end + create_table "jobs", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| + t.string "name_en" + t.string "name_jp" + t.integer "proficiency1" + t.integer "proficiency2" + t.string "row" + t.boolean "ml", default: false + end + create_table "oauth_access_grants", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| t.uuid "resource_owner_id", null: false t.uuid "application_id", null: false @@ -159,9 +159,9 @@ ActiveRecord::Schema.define(version: 2022_03_22_092821) do t.uuid "raid_id" t.integer "element" t.integer "weapons_count" - t.uuid "class_id" + t.uuid "job_id" t.integer "ml" - t.index ["class_id"], name: "index_parties_on_class_id" + t.index ["job_id"], name: "index_parties_on_job_id" t.index ["user_id"], name: "index_parties_on_user_id" end @@ -256,7 +256,7 @@ ActiveRecord::Schema.define(version: 2022_03_22_092821) 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", "classes" + add_foreign_key "parties", "jobs" add_foreign_key "parties", "raids" add_foreign_key "parties", "users" end