hensei-api/db/migrate/20250302080224_create_character_skills.rb
Justin Edmund 7b88932e2c Add migrations for skill tables
These tables allow us to store data about:
* Character and Weapon charge attacks
* Character active and support skills
* Weapon skills
* Summon calls
* Summon auras and subauras
2025-03-02 16:24:24 -08:00

19 lines
807 B
Ruby

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