diff --git a/db/migrate/20230315112807_add_quick_summon_to_grid_summons.rb b/db/migrate/20230315112807_add_quick_summon_to_grid_summons.rb new file mode 100644 index 0000000..a50b5f0 --- /dev/null +++ b/db/migrate/20230315112807_add_quick_summon_to_grid_summons.rb @@ -0,0 +1,5 @@ +class AddQuickSummonToGridSummons < ActiveRecord::Migration[7.0] + def change + add_column :grid_summons, :quick_summon, :boolean, default: false, null: false + end +end diff --git a/db/migrate/20230418052314_add_guidebooks.rb b/db/migrate/20230418052314_add_guidebooks.rb new file mode 100644 index 0000000..c74e306 --- /dev/null +++ b/db/migrate/20230418052314_add_guidebooks.rb @@ -0,0 +1,12 @@ +class AddGuidebooks < ActiveRecord::Migration[7.0] + def change + create_table :guidebooks, id: :uuid, default: -> { "gen_random_uuid()" } do |t| + t.string :granblue_id, null: false, unique: true + t.string :name_en, null: false, unique: true + t.string :name_jp, null: false, unique: true + t.string :description_en, null: false + t.string :description_jp, null: false + t.timestamps + end + end +end diff --git a/db/migrate/20230418052325_add_guidebooks_to_party.rb b/db/migrate/20230418052325_add_guidebooks_to_party.rb new file mode 100644 index 0000000..9c05639 --- /dev/null +++ b/db/migrate/20230418052325_add_guidebooks_to_party.rb @@ -0,0 +1,5 @@ +class AddGuidebooksToParty < ActiveRecord::Migration[7.0] + def change + add_column :parties, :guidebooks, :uuid, array: true, default: [], null: false + end +end diff --git a/db/migrate/20230418061932_update_guidebooks_structure.rb b/db/migrate/20230418061932_update_guidebooks_structure.rb new file mode 100644 index 0000000..c7005df --- /dev/null +++ b/db/migrate/20230418061932_update_guidebooks_structure.rb @@ -0,0 +1,6 @@ +class UpdateGuidebooksStructure < ActiveRecord::Migration[7.0] + def change + remove_column :guidebooks, :updated_at + change_column_default :guidebooks, :created_at, -> { 'CURRENT_TIMESTAMP' } + end +end diff --git a/db/migrate/20230418071647_rename_guidebooks_to_guidebook_i_ds.rb b/db/migrate/20230418071647_rename_guidebooks_to_guidebook_i_ds.rb new file mode 100644 index 0000000..7b80062 --- /dev/null +++ b/db/migrate/20230418071647_rename_guidebooks_to_guidebook_i_ds.rb @@ -0,0 +1,5 @@ +class RenameGuidebooksToGuidebookIDs < ActiveRecord::Migration[7.0] + def change + rename_column :parties, :guidebooks, :guidebook_ids + end +end diff --git a/db/migrate/20230419033648_split_guidebooks_on_party.rb b/db/migrate/20230419033648_split_guidebooks_on_party.rb new file mode 100644 index 0000000..08dc2d2 --- /dev/null +++ b/db/migrate/20230419033648_split_guidebooks_on_party.rb @@ -0,0 +1,8 @@ +class SplitGuidebooksOnParty < ActiveRecord::Migration[7.0] + def change + remove_column :parties, :guidebook_ids + add_reference :parties, :guidebook0, type: :uuid, foreign_key: { to_table: :guidebooks } + add_reference :parties, :guidebook1, type: :uuid, foreign_key: { to_table: :guidebooks } + add_reference :parties, :guidebook2, type: :uuid, foreign_key: { to_table: :guidebooks } + end +end diff --git a/db/migrate/20230419102354_rename_guidebook_columns.rb b/db/migrate/20230419102354_rename_guidebook_columns.rb new file mode 100644 index 0000000..f7116f6 --- /dev/null +++ b/db/migrate/20230419102354_rename_guidebook_columns.rb @@ -0,0 +1,5 @@ +class RenameGuidebookColumns < ActiveRecord::Migration[7.0] + def change + rename_column :parties, :guidebook0_id, :guidebook3_id + end +end diff --git a/db/migrate/20230423070004_add_gacha_table.rb b/db/migrate/20230423070004_add_gacha_table.rb new file mode 100644 index 0000000..264051a --- /dev/null +++ b/db/migrate/20230423070004_add_gacha_table.rb @@ -0,0 +1,13 @@ +class AddGachaTable < ActiveRecord::Migration[7.0] + create_table :gacha, id: :uuid, default: -> { "gen_random_uuid()" } do |t| + t.references :drawable, polymorphic: true + t.boolean :premium + t.boolean :classic + t.boolean :flash + t.boolean :legend + t.boolean :valentines + t.boolean :summer + t.boolean :halloween + t.boolean :holiday + end +end diff --git a/db/migrate/20230423071446_add_recruits_to_weapon.rb b/db/migrate/20230423071446_add_recruits_to_weapon.rb new file mode 100644 index 0000000..21dbf1e --- /dev/null +++ b/db/migrate/20230423071446_add_recruits_to_weapon.rb @@ -0,0 +1,5 @@ +class AddRecruitsToWeapon < ActiveRecord::Migration[7.0] + def change + add_reference :weapons, :recruits, null: true, to_table: 'character_id', type: :uuid + end +end diff --git a/db/migrate/20230423125524_change_gacha_drawable_id_to_uuid.rb b/db/migrate/20230423125524_change_gacha_drawable_id_to_uuid.rb new file mode 100644 index 0000000..e274ffe --- /dev/null +++ b/db/migrate/20230423125524_change_gacha_drawable_id_to_uuid.rb @@ -0,0 +1,7 @@ +class ChangeGachaDrawableIdToUuid < ActiveRecord::Migration[7.0] + def change + remove_column :gacha, :drawable_id, :bigint + remove_column :gacha, :drawable_type, :string + add_reference :gacha, :drawable, polymorphic: true, type: :uuid + end +end diff --git a/db/migrate/20230423132430_make_gacha_drawable_id_unique.rb b/db/migrate/20230423132430_make_gacha_drawable_id_unique.rb new file mode 100644 index 0000000..3181999 --- /dev/null +++ b/db/migrate/20230423132430_make_gacha_drawable_id_unique.rb @@ -0,0 +1,5 @@ +class MakeGachaDrawableIdUnique < ActiveRecord::Migration[7.0] + def change + add_index :gacha, :drawable_id, unique: true + end +end diff --git a/db/migrate/20230502012823_add_gacha_rateups_table.rb b/db/migrate/20230502012823_add_gacha_rateups_table.rb new file mode 100644 index 0000000..da7c72f --- /dev/null +++ b/db/migrate/20230502012823_add_gacha_rateups_table.rb @@ -0,0 +1,8 @@ +class AddGachaRateupsTable < ActiveRecord::Migration[7.0] + create_table :gacha_rateups, id: :uuid, default: -> { "gen_random_uuid()" } do |t| + t.references :gacha, type: :uuid + t.string :user_id + t.numeric :rate + t.datetime :created_at, null: false, default: -> { 'CURRENT_TIMESTAMP' } + end +end diff --git a/db/migrate/20230503221903_add_sparks_table.rb b/db/migrate/20230503221903_add_sparks_table.rb new file mode 100644 index 0000000..fca83e0 --- /dev/null +++ b/db/migrate/20230503221903_add_sparks_table.rb @@ -0,0 +1,11 @@ +class AddSparksTable < ActiveRecord::Migration[7.0] + create_table :sparks, id: :uuid, default: -> { "gen_random_uuid()" } do |t| + t.string :user_id, null: false + t.string :guild_ids, array: true, null: false + t.integer :crystals, default: 0 + t.integer :tickets, default: 0 + t.integer :ten_tickets, default: 0 + t.references :target, polymorphic: true + t.datetime :updated_at, null: false, default: -> { 'CURRENT_TIMESTAMP' } + end +end diff --git a/db/migrate/20230503224345_add_target_memo_to_sparks.rb b/db/migrate/20230503224345_add_target_memo_to_sparks.rb new file mode 100644 index 0000000..c31caea --- /dev/null +++ b/db/migrate/20230503224345_add_target_memo_to_sparks.rb @@ -0,0 +1,5 @@ +class AddTargetMemoToSparks < ActiveRecord::Migration[7.0] + def change + add_column :sparks, :target_memo, :string + end +end diff --git a/db/migrate/20230503224353_make_user_id_unique_in_sparks.rb b/db/migrate/20230503224353_make_user_id_unique_in_sparks.rb new file mode 100644 index 0000000..16ffff6 --- /dev/null +++ b/db/migrate/20230503224353_make_user_id_unique_in_sparks.rb @@ -0,0 +1,5 @@ +class MakeUserIdUniqueInSparks < ActiveRecord::Migration[7.0] + def change + add_index :sparks, :user_id, unique: true + end +end diff --git a/db/migrate/20230529210259_add_raid_groups_table.rb b/db/migrate/20230529210259_add_raid_groups_table.rb new file mode 100644 index 0000000..7803d82 --- /dev/null +++ b/db/migrate/20230529210259_add_raid_groups_table.rb @@ -0,0 +1,16 @@ +class AddRaidGroupsTable < ActiveRecord::Migration[7.0] + def up + create_table :raid_groups, id: :uuid, default: -> { "gen_random_uuid()" } do |t| + t.string :name_en, null: false + t.string :name_jp, null: false + t.integer :difficulty + t.integer :order, null: false + t.integer :section, default: 1, null: false + t.boolean :extra, default: false, null: false + end + end + + def down + drop_table :raid_groups + end +end diff --git a/db/migrate/20230529215259_add_raid_group_to_raids.rb b/db/migrate/20230529215259_add_raid_group_to_raids.rb new file mode 100644 index 0000000..e708a20 --- /dev/null +++ b/db/migrate/20230529215259_add_raid_group_to_raids.rb @@ -0,0 +1,6 @@ +class AddRaidGroupToRaids < ActiveRecord::Migration[7.0] + def change + add_reference :raids, :group, null: true, to_table: 'raid_groups', type: :uuid + add_foreign_key :raids, :raid_groups, column: :group_id + end +end diff --git a/db/migrate/20230530000739_add_hl_to_raid_groups.rb b/db/migrate/20230530000739_add_hl_to_raid_groups.rb new file mode 100644 index 0000000..c302776 --- /dev/null +++ b/db/migrate/20230530000739_add_hl_to_raid_groups.rb @@ -0,0 +1,5 @@ +class AddHlToRaidGroups < ActiveRecord::Migration[7.0] + def change + add_column :raid_groups, :hl, :boolean, default: true, null: false + end +end diff --git a/db/migrate/20230531115422_remove_group_integer_from_raids.rb b/db/migrate/20230531115422_remove_group_integer_from_raids.rb new file mode 100644 index 0000000..e315719 --- /dev/null +++ b/db/migrate/20230531115422_remove_group_integer_from_raids.rb @@ -0,0 +1,5 @@ +class RemoveGroupIntegerFromRaids < ActiveRecord::Migration[7.0] + def change + remove_column :raids, :group, :integer + end +end diff --git a/db/migrate/20230618051308_add_guidebooks_to_raid_groups.rb b/db/migrate/20230618051308_add_guidebooks_to_raid_groups.rb new file mode 100644 index 0000000..1120a47 --- /dev/null +++ b/db/migrate/20230618051308_add_guidebooks_to_raid_groups.rb @@ -0,0 +1,5 @@ +class AddGuidebooksToRaidGroups < ActiveRecord::Migration[7.0] + def change + add_column :raid_groups, :guidebooks, :boolean, default: false, null: false + end +end diff --git a/db/migrate/20230618051638_add_auto_summon_to_parties.rb b/db/migrate/20230618051638_add_auto_summon_to_parties.rb new file mode 100644 index 0000000..ba91a4b --- /dev/null +++ b/db/migrate/20230618051638_add_auto_summon_to_parties.rb @@ -0,0 +1,5 @@ +class AddAutoSummonToParties < ActiveRecord::Migration[7.0] + def change + add_column :parties, :auto_summon, :boolean, default: false, null: false + end +end diff --git a/db/schema.rb b/db/schema.rb index 6a87c0b..b8046e4 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,6 +10,7 @@ # # 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 # These are extensions that must be enabled in order to support this database enable_extension "btree_gin"