diff --git a/db/migrate/20250302080159_create_effects.rb b/db/migrate/20250302080159_create_effects.rb new file mode 100644 index 0000000..efd2a25 --- /dev/null +++ b/db/migrate/20250302080159_create_effects.rb @@ -0,0 +1,21 @@ +class CreateEffects < ActiveRecord::Migration[8.0] + def change + create_table :effects, id: :uuid do |t| + t.string :name_en, null: false + t.string :name_jp + t.text :description_en + t.text :description_jp + t.string :icon_path + t.integer :effect_type, null: false # 1=buff, 2=debuff, 3=special + t.string :effect_class # classification (cant_act, burn, poison) + t.uuid :effect_family_id # no foreign key here + t.boolean :stackable, default: false + t.timestamps null: false + end + + add_foreign_key :effects, :effects, column: :effect_family_id + + add_index :effects, :effect_class + add_index :effects, :name_en + end +end diff --git a/db/migrate/20250302080203_create_skills.rb b/db/migrate/20250302080203_create_skills.rb new file mode 100644 index 0000000..ab96a7d --- /dev/null +++ b/db/migrate/20250302080203_create_skills.rb @@ -0,0 +1,17 @@ +class CreateSkills < ActiveRecord::Migration[8.0] + def change + create_table :skills, id: :uuid do |t| + t.string :name_en, null: false + t.string :name_jp + t.text :description_en + t.text :description_jp + t.integer :border_type # 1=red(dmg), 2=green(heal), 3=yellow(buff), 4=blue(debuff), 5=purple(field) + t.integer :cooldown + t.integer :skill_type # 1=character, 2=weapon, 3=summon call, 4=charge attack + t.timestamps null: false + end + + add_index :skills, :name_en + add_index :skills, :skill_type + end +end diff --git a/db/migrate/20250302080212_create_skill_values.rb b/db/migrate/20250302080212_create_skill_values.rb new file mode 100644 index 0000000..a9a4faa --- /dev/null +++ b/db/migrate/20250302080212_create_skill_values.rb @@ -0,0 +1,14 @@ +class CreateSkillValues < ActiveRecord::Migration[8.0] + def change + create_table :skill_values, id: :uuid do |t| + t.references :skill, type: :uuid, null: false + t.integer :level, null: false, default: 1 # skill level or uncap level + t.decimal :value # numeric value for multiplier + t.string :text_value # text description for non-numeric values + t.timestamps null: false + end + + add_foreign_key :skill_values, :skills + add_index :skill_values, %i[skill_id level], unique: true + end +end diff --git a/db/migrate/20250302080218_create_skill_effects.rb b/db/migrate/20250302080218_create_skill_effects.rb new file mode 100644 index 0000000..b2b1ed7 --- /dev/null +++ b/db/migrate/20250302080218_create_skill_effects.rb @@ -0,0 +1,23 @@ +class CreateSkillEffects < ActiveRecord::Migration[8.0] + def change + create_table :skill_effects, id: :uuid do |t| + t.references :skill, type: :uuid, null: false + t.references :effect, type: :uuid, null: false + t.integer :target_type # 1=self, 2=ally, 3=all allies, 4=enemy, 5=all enemies + t.integer :duration_type # 1=turns, 2=seconds, 3=indefinite, 4=one-time + t.integer :duration_value # number of turns/seconds if applicable + t.text :condition # condition text + t.integer :chance # percentage chance to apply + t.decimal :value # value for effect if applicable + t.decimal :cap # cap for effect if applicable + t.boolean :local, default: true # local vs global effect + t.boolean :permanent, default: false # permanent + t.boolean :undispellable, default: false # can't be dispelled + t.timestamps null: false + end + + add_foreign_key :skill_effects, :skills, name: 'fk_skill_effects_skills' + add_foreign_key :skill_effects, :effects, name: 'fk_skill_effects_effects' + add_index :skill_effects, %i[skill_id effect_id target_type] + end +end diff --git a/db/migrate/20250302080224_create_character_skills.rb b/db/migrate/20250302080224_create_character_skills.rb new file mode 100644 index 0000000..e368972 --- /dev/null +++ b/db/migrate/20250302080224_create_character_skills.rb @@ -0,0 +1,19 @@ +class CreateCharacterSkills < ActiveRecord::Migration[8.0] + def change + create_table :character_skills, id: :uuid do |t| + t.string :character_granblue_id, null: false + t.references :skill, type: :uuid, null: false + t.integer :position, null: false # 1, 2, 3, 4 for skill slots + t.integer :unlock_level # level when skill unlocked + t.integer :improve_level # level when skill improved (+) + t.references :alt_skill, type: :uuid + t.text :alt_condition # condition for alt version + t.timestamps null: false + end + + add_foreign_key :character_skills, :skills + add_foreign_key :character_skills, :skills, column: :alt_skill_id + add_index :character_skills, %i[character_granblue_id position] + add_index :character_skills, :character_granblue_id + end +end diff --git a/db/migrate/20250302080231_create_weapon_skills.rb b/db/migrate/20250302080231_create_weapon_skills.rb new file mode 100644 index 0000000..f9be6e3 --- /dev/null +++ b/db/migrate/20250302080231_create_weapon_skills.rb @@ -0,0 +1,19 @@ +class CreateWeaponSkills < ActiveRecord::Migration[8.0] + def change + create_table :weapon_skills, id: :uuid do |t| + t.string :weapon_granblue_id, null: false + t.references :skill, type: :uuid, null: false + t.integer :position, null: false # 1, 2, 3 for skill slots + t.string :skill_modifier # Modifier like "Might", "Majesty" + t.string :skill_series # Series like "Ironflame", "Hoarfrost" + t.string :skill_size # Size like "Small", "Medium", "Big", "Massive" + t.integer :unlock_level # level when skill unlocked + t.timestamps null: false + end + + add_foreign_key :weapon_skills, :skills + add_index :weapon_skills, %i[weapon_granblue_id position] + add_index :weapon_skills, :weapon_granblue_id + add_index :weapon_skills, :skill_series + end +end diff --git a/db/migrate/20250302080239_create_summon_auras.rb b/db/migrate/20250302080239_create_summon_auras.rb new file mode 100644 index 0000000..58661bb --- /dev/null +++ b/db/migrate/20250302080239_create_summon_auras.rb @@ -0,0 +1,18 @@ +class CreateSummonAuras < ActiveRecord::Migration[8.0] + def change + create_table :summon_auras, id: :uuid do |t| + t.string :summon_granblue_id, null: false + t.text :description_en + t.text :description_jp + t.integer :aura_type # 1=main, 2=sub + t.integer :boost_type # 1=weapon skill, 2=elemental, 3=stat + t.string :boost_target # what is being boosted + t.decimal :boost_value # percentage value + t.integer :uncap_level # 0, 3, 4, 5 for uncap level + t.text :condition # any conditions + t.timestamps null: false + end + add_index :summon_auras, %i[summon_granblue_id aura_type uncap_level] + add_index :summon_auras, :summon_granblue_id + end +end diff --git a/db/migrate/20250302080243_create_summon_calls.rb b/db/migrate/20250302080243_create_summon_calls.rb new file mode 100644 index 0000000..fa8da68 --- /dev/null +++ b/db/migrate/20250302080243_create_summon_calls.rb @@ -0,0 +1,18 @@ +class CreateSummonCalls < ActiveRecord::Migration[8.0] + def change + create_table :summon_calls, id: :uuid do |t| + t.string :summon_granblue_id, null: false + t.references :skill, type: :uuid, null: false + t.integer :cooldown + t.integer :uncap_level # 0, 3, 4, 5 for uncap level + t.references :alt_skill, type: :uuid + t.text :alt_condition # condition for alt version + t.timestamps null: false + end + + add_foreign_key :summon_calls, :skills + add_foreign_key :summon_calls, :skills, column: :alt_skill_id + add_index :summon_calls, %i[summon_granblue_id uncap_level] + add_index :summon_calls, :summon_granblue_id + end +end diff --git a/db/migrate/20250302080540_create_charge_attacks.rb b/db/migrate/20250302080540_create_charge_attacks.rb new file mode 100644 index 0000000..9026e13 --- /dev/null +++ b/db/migrate/20250302080540_create_charge_attacks.rb @@ -0,0 +1,17 @@ +class CreateChargeAttacks < ActiveRecord::Migration[8.0] + def change + create_table :charge_attacks, id: :uuid do |t| + t.string :owner_id, null: false # can be character_granblue_id or weapon_granblue_id + t.string :owner_type, null: false # "character" or "weapon" + t.references :skill, type: :uuid, null: false + t.integer :uncap_level # 0, 3, 4, 5 for uncap level + t.references :alt_skill, type: :uuid + t.text :alt_condition # condition for alt version + t.timestamps null: false + end + + add_foreign_key :charge_attacks, :skills + add_foreign_key :charge_attacks, :skills, column: :alt_skill_id + add_index :charge_attacks, %i[owner_type owner_id uncap_level] + end +end