This adds migrations and data migrations for the awakening update. * A new `Awakenings` table now exists that stores all possible awakenings, with a column for object type. * GridCharacter and GridWeapon now have `awakening_id` and `awakening_level` fields. Their `awakening` and `awakening_type` fields were removed. * Weapons have a mapping table, `WeaponAwakenings`, as not all weapons can be awakened. * Data migrations are included to migrate existing user data. They should be run automatically when the migration is run with `rails db:migrate:with_data`
8 lines
334 B
Ruby
8 lines
334 B
Ruby
class CreateWeaponAwakeningsTable < ActiveRecord::Migration[7.0]
|
|
def change
|
|
create_table :weapon_awakenings, id: :uuid, default: -> { "gen_random_uuid()" } do |t|
|
|
t.references :weapon, null: false, foreign_key: true, type: :uuid
|
|
t.references :awakening, null: false, foreign_key: true, type: :uuid
|
|
end
|
|
end
|
|
end
|