From 8bef63d521c698500c4bc8ed939602d6ec4f44c8 Mon Sep 17 00:00:00 2001 From: Justin Edmund Date: Wed, 15 Mar 2023 04:24:06 -0700 Subject: [PATCH] Add tables for storing character skills and effects --- db/migrate/20230315111940_create_effects.rb | 32 +++++++++++++++++++ .../20230315111945_create_character_skills.rb | 25 +++++++++++++++ ...5112015_create_character_charge_attacks.rb | 18 +++++++++++ ...5112024_create_character_support_skills.rb | 21 ++++++++++++ 4 files changed, 96 insertions(+) create mode 100644 db/migrate/20230315111940_create_effects.rb create mode 100644 db/migrate/20230315111945_create_character_skills.rb create mode 100644 db/migrate/20230315112015_create_character_charge_attacks.rb create mode 100644 db/migrate/20230315112024_create_character_support_skills.rb diff --git a/db/migrate/20230315111940_create_effects.rb b/db/migrate/20230315111940_create_effects.rb new file mode 100644 index 0000000..6533812 --- /dev/null +++ b/db/migrate/20230315111940_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/20230315111945_create_character_skills.rb b/db/migrate/20230315111945_create_character_skills.rb new file mode 100644 index 0000000..c754874 --- /dev/null +++ b/db/migrate/20230315111945_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/20230315112015_create_character_charge_attacks.rb b/db/migrate/20230315112015_create_character_charge_attacks.rb new file mode 100644 index 0000000..befc51e --- /dev/null +++ b/db/migrate/20230315112015_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/20230315112024_create_character_support_skills.rb b/db/migrate/20230315112024_create_character_support_skills.rb new file mode 100644 index 0000000..e43615d --- /dev/null +++ b/db/migrate/20230315112024_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