From ae060bec187f521a5aa0a80b90c75e08c113e615 Mon Sep 17 00:00:00 2001 From: Justin Edmund Date: Thu, 16 Mar 2023 08:38:20 -0700 Subject: [PATCH] Add Ultimate Mastery and other job mastery updates (#78) * Small Rails 7 configuration changes (#72) * Remove log call * Show EMP skills for Row 5 classes Row 4 EMP skills were not showing up, so you couldn't set Rage IV on Viking, for example * Allow adding EMP skills from prior rows to team We let you search but didn't fix the server-side validation check for skills * Add `granblue_id` column to WeaponKeys table This should have a `NOT NULL` constraint, but due to existing data it is nullable until we can update all environments with values. * Add granblue_id to WeaponKeyBlueprint * Rename ml to master level * Add Ultimate Mastery * Migrate database * Migrate database --- app/blueprints/api/v1/job_blueprint.rb | 4 +++- app/blueprints/api/v1/party_blueprint.rb | 5 ++++- db/migrate/20230315103026_add_ultimate_mastery.rb | 6 ++++++ db/migrate/20230315103037_rename_master_level.rb | 7 +++++++ db/schema.rb | 2 +- 5 files changed, 21 insertions(+), 3 deletions(-) create mode 100644 db/migrate/20230315103026_add_ultimate_mastery.rb create mode 100644 db/migrate/20230315103037_rename_master_level.rb diff --git a/app/blueprints/api/v1/job_blueprint.rb b/app/blueprints/api/v1/job_blueprint.rb index fe9a079..ba2c9f1 100644 --- a/app/blueprints/api/v1/job_blueprint.rb +++ b/app/blueprints/api/v1/job_blueprint.rb @@ -17,7 +17,9 @@ module Api ] end - fields :granblue_id, :row, :ml, :order, :accessory, :accessory_type + fields :granblue_id, :row, :order, + :master_level, :ultimate_mastery, + :accessory, :accessory_type end end end diff --git a/app/blueprints/api/v1/party_blueprint.rb b/app/blueprints/api/v1/party_blueprint.rb index 61bb005..5b26778 100644 --- a/app/blueprints/api/v1/party_blueprint.rb +++ b/app/blueprints/api/v1/party_blueprint.rb @@ -52,6 +52,7 @@ module Api end view :jobs do + association :job, blueprint: JobBlueprint include_view :job_skills @@ -68,7 +69,9 @@ module Api include_view :characters include_view :job_skills - fields :local_id, :description, :charge_attack, :button_count, :turn_count, :chain_count + fields :local_id, :description, :charge_attack, + :button_count, :turn_count, :chain_count, + :master_level, :ultimate_mastery association :accessory, blueprint: JobAccessoryBlueprint diff --git a/db/migrate/20230315103026_add_ultimate_mastery.rb b/db/migrate/20230315103026_add_ultimate_mastery.rb new file mode 100644 index 0000000..149a2a1 --- /dev/null +++ b/db/migrate/20230315103026_add_ultimate_mastery.rb @@ -0,0 +1,6 @@ +class AddUltimateMastery < ActiveRecord::Migration[7.0] + def change + add_column :parties, :ultimate_mastery, :integer, null: true + add_column :jobs, :ultimate_mastery, :boolean, default: false, null: false + end +end diff --git a/db/migrate/20230315103037_rename_master_level.rb b/db/migrate/20230315103037_rename_master_level.rb new file mode 100644 index 0000000..d6ced1d --- /dev/null +++ b/db/migrate/20230315103037_rename_master_level.rb @@ -0,0 +1,7 @@ +class RenameMasterLevel < ActiveRecord::Migration[7.0] + def change + rename_column :parties, :ml, :master_level + rename_column :jobs, :ml, :master_level + change_column_null :jobs, :master_level, false + end +end diff --git a/db/schema.rb b/db/schema.rb index e354921..2694fd6 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[7.0].define(version: 2023_03_15_095656) do +ActiveRecord::Schema[7.0].define(version: 2023_03_15_103037) do # These are extensions that must be enabled in order to support this database enable_extension "btree_gin" enable_extension "pg_trgm"