From c8eb9187d6dbe2ffdd02f30b875013f987ebc9c0 Mon Sep 17 00:00:00 2001 From: Justin Edmund Date: Sat, 11 Mar 2023 01:19:26 -0800 Subject: [PATCH] Add migrations for character skills Adds new tables for: * Character skills * Character charge attacks * Character support skills * Ability effects Also adds flags on GridCharacter for whether an ability is enabled or disabled in full auto --- db/migrate/20230311073805_create_effects.rb | 32 +++++++++++++++++++ .../20230311073806_create_character_skills.rb | 25 +++++++++++++++ ...1073807_create_character_charge_attacks.rb | 18 +++++++++++ ...1073808_create_character_support_skills.rb | 21 ++++++++++++ ...add_full_auto_toggles_to_grid_character.rb | 12 +++++++ 5 files changed, 108 insertions(+) create mode 100644 db/migrate/20230311073805_create_effects.rb create mode 100644 db/migrate/20230311073806_create_character_skills.rb create mode 100644 db/migrate/20230311073807_create_character_charge_attacks.rb create mode 100644 db/migrate/20230311073808_create_character_support_skills.rb create mode 100644 db/migrate/20230311073814_add_full_auto_toggles_to_grid_character.rb diff --git a/db/migrate/20230311073805_create_effects.rb b/db/migrate/20230311073805_create_effects.rb new file mode 100644 index 0000000..6533812 --- /dev/null +++ b/db/migrate/20230311073805_create_effects.rb @@ -0,0 +1,32 @@ +class CreateEffects < ActiveRecord::Migration[7.0] + def change + create_table :effects, id: :uuid, default: -> { "gen_random_uuid()" } do |t| + t.string :name_en, null: false + t.string :name_jp, null: false + + t.string :description_en, null: false + t.string :description_jp, null: false + + t.integer :accuracy_value + t.string :accuracy_suffix + t.string :accuracy_comparator + + t.jsonb :strength, array: true + # { + # "min": integer, + # "max": integer, + # "value": integer, + # "suffix": string + # } + + t.integer :healing_cap + + t.boolean :duration_indefinite, default: false, null: false + t.integer :duration_value + t.string :duration_unit + + t.string :notes_en + t.string :notes_jp + end + end +end diff --git a/db/migrate/20230311073806_create_character_skills.rb b/db/migrate/20230311073806_create_character_skills.rb new file mode 100644 index 0000000..c754874 --- /dev/null +++ b/db/migrate/20230311073806_create_character_skills.rb @@ -0,0 +1,25 @@ +class CreateCharacterSkills < ActiveRecord::Migration[7.0] + def change + create_table :character_skills, id: :uuid, default: -> { "gen_random_uuid()" } do |t| + t.references :character, type: :uuid + + t.string :name_en, unique: true, null: false + t.string :name_jp, unique: true, null: false + + t.string :description_en, unique: true, null: false + t.string :description_jp, unique: true, null: false + + t.integer :type, null: false + t.integer :position, null: false + + t.string :form + t.integer :cooldown, default: 0, null: false + t.integer :lockout, default: 0, null: false + t.integer :duration, array: true + t.boolean :recast, default: false, null: false + t.integer :obtained_at, default: 1, null: false + + t.uuid :effects, array: true + end + end +end diff --git a/db/migrate/20230311073807_create_character_charge_attacks.rb b/db/migrate/20230311073807_create_character_charge_attacks.rb new file mode 100644 index 0000000..befc51e --- /dev/null +++ b/db/migrate/20230311073807_create_character_charge_attacks.rb @@ -0,0 +1,18 @@ +class CreateCharacterChargeAttacks < ActiveRecord::Migration[7.0] + def change + create_table :character_charge_attacks, id: :uuid, default: -> { "gen_random_uuid()" } do |t| + t.references :character, type: :uuid + + t.string :name_en, unique: true, null: false + t.string :name_jp, unique: true, null: false + + t.string :description_en, unique: true, null: false + t.string :description_jp, unique: true, null: false + + t.integer :order, null: false + t.string :form + + t.uuid :effects, array: true + end + end +end diff --git a/db/migrate/20230311073808_create_character_support_skills.rb b/db/migrate/20230311073808_create_character_support_skills.rb new file mode 100644 index 0000000..e43615d --- /dev/null +++ b/db/migrate/20230311073808_create_character_support_skills.rb @@ -0,0 +1,21 @@ +class CreateCharacterSupportSkills < ActiveRecord::Migration[7.0] + def change + create_table :character_support_skills, id: :uuid, default: -> { "gen_random_uuid()" } do |t| + t.references :character, type: :uuid + + t.string :name_en, unique: true, null: false + t.string :name_jp, unique: true, null: false + + t.string :description_en, unique: true, null: false + t.string :description_jp, unique: true, null: false + + t.integer :position, null: false + t.integer :obtained_at + + t.boolean :emp, default: false, null: false + t.boolean :transcendence, default: false, null: false + + t.uuid :effects, array: true + end + end +end diff --git a/db/migrate/20230311073814_add_full_auto_toggles_to_grid_character.rb b/db/migrate/20230311073814_add_full_auto_toggles_to_grid_character.rb new file mode 100644 index 0000000..4278108 --- /dev/null +++ b/db/migrate/20230311073814_add_full_auto_toggles_to_grid_character.rb @@ -0,0 +1,12 @@ +class AddFullAutoTogglesToGridCharacter < ActiveRecord::Migration[7.0] + def change + change_table(:grid_characters) do |t| + t.boolean :skill0_enabled, null: false, default: true + t.boolean :skill1_enabled, null: false, default: true + t.boolean :skill2_enabled, null: false, default: true + t.boolean :skill3_enabled, null: false, default: true + end + end +end + +Í