Add tables for storing character skills and effects

This commit is contained in:
Justin Edmund 2023-03-15 04:24:06 -07:00
parent 1fe6f45cae
commit 8bef63d521
4 changed files with 96 additions and 0 deletions

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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