From 0befd788fc1a407d463a15c1943d8734c5f6d845 Mon Sep 17 00:00:00 2001 From: Justin Edmund Date: Wed, 21 Jun 2023 00:35:31 -0700 Subject: [PATCH] (Hotfix) Fix stale migrations (#107) * Remove print statements from data migration * (Hotfix) Fix data migration failing due to nil * Fix stale migration errors --- db/migrate/20230618051638_init_schema.rb | 2 -- ..._auto_summon_to_grid_summons_and_parties.rb | 6 ++++++ db/schema.rb | 18 +++++++++++++----- 3 files changed, 19 insertions(+), 7 deletions(-) create mode 100644 db/migrate/20230621073125_re_add_quick_summon_and_auto_summon_to_grid_summons_and_parties.rb diff --git a/db/migrate/20230618051638_init_schema.rb b/db/migrate/20230618051638_init_schema.rb index 2fe820f..16c6540 100644 --- a/db/migrate/20230618051638_init_schema.rb +++ b/db/migrate/20230618051638_init_schema.rb @@ -95,7 +95,6 @@ class InitSchema < ActiveRecord::Migration[7.0] t.datetime "created_at", null: false t.datetime "updated_at", null: false t.integer "transcendence_step", default: 0, null: false - t.boolean "quick_summon", default: false, null: false t.index ["party_id"], name: "index_grid_summons_on_party_id" t.index ["summon_id"], name: "index_grid_summons_on_summon_id" end @@ -238,7 +237,6 @@ class InitSchema < ActiveRecord::Migration[7.0] t.uuid "guidebook3_id" t.uuid "guidebook1_id" t.uuid "guidebook2_id" - t.boolean "auto_summon", default: false, null: false t.index ["accessory_id"], name: "index_parties_on_accessory_id" t.index ["guidebook1_id"], name: "index_parties_on_guidebook1_id" t.index ["guidebook2_id"], name: "index_parties_on_guidebook2_id" diff --git a/db/migrate/20230621073125_re_add_quick_summon_and_auto_summon_to_grid_summons_and_parties.rb b/db/migrate/20230621073125_re_add_quick_summon_and_auto_summon_to_grid_summons_and_parties.rb new file mode 100644 index 0000000..de3d369 --- /dev/null +++ b/db/migrate/20230621073125_re_add_quick_summon_and_auto_summon_to_grid_summons_and_parties.rb @@ -0,0 +1,6 @@ +class ReAddQuickSummonAndAutoSummonToGridSummonsAndParties < ActiveRecord::Migration[7.0] + def change + add_column :grid_summons, :quick_summon, :boolean, default: false, if_not_exists: true + add_column :parties, :auto_summon, :boolean, default: false, if_not_exists: true + end +end diff --git a/db/schema.rb b/db/schema.rb index dd5ba57..9f52e13 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,13 +10,12 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema[7.0].define(version: 2023_06_19_045651) do +ActiveRecord::Schema[7.0].define(version: 2023_06_21_073125) do # These are extensions that must be enabled in order to support this database enable_extension "btree_gin" enable_extension "pg_trgm" enable_extension "pgcrypto" enable_extension "plpgsql" - enable_extension "timescaledb" create_table "app_updates", primary_key: "updated_at", id: :datetime, force: :cascade do |t| t.string "update_type", null: false @@ -65,9 +64,14 @@ ActiveRecord::Schema[7.0].define(version: 2023_06_19_045651) do t.uuid "character_id" t.string "name_en", null: false t.string "name_jp", null: false - t.string "slug", null: false - t.string "object_type", null: false - t.integer "order", default: 0, null: false + t.string "description_en", null: false + t.string "description_jp", 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 + t.index ["character_id"], name: "index_character_support_skills_on_character_id" end create_table "characters", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t| @@ -97,6 +101,8 @@ ActiveRecord::Schema[7.0].define(version: 2023_06_19_045651) do t.integer "max_hp_ulb" t.integer "max_atk_ulb" t.integer "character_id", default: [], null: false, array: true + t.string "nicknames_en", default: [], null: false, array: true + t.string "nicknames_jp", default: [], null: false, array: true t.index ["name_en"], name: "index_characters_on_name_en", opclass: :gin_trgm_ops, using: :gin end @@ -412,6 +418,8 @@ ActiveRecord::Schema[7.0].define(version: 2023_06_19_045651) do t.boolean "xlb", default: false, null: false t.integer "max_atk_xlb" t.integer "max_hp_xlb" + t.string "nicknames_en", default: [], null: false, array: true + t.string "nicknames_jp", default: [], null: false, array: true t.index ["name_en"], name: "index_summons_on_name_en", opclass: :gin_trgm_ops, using: :gin end