Merge branch 'staging' into awakening

This commit is contained in:
Justin Edmund 2023-06-19 00:32:49 -07:00 committed by GitHub
commit 9f218987b3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
22 changed files with 148 additions and 0 deletions

View file

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

View file

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

View file

@ -0,0 +1,5 @@
class AddGuidebooksToParty < ActiveRecord::Migration[7.0]
def change
add_column :parties, :guidebooks, :uuid, array: true, default: [], null: false
end
end

View file

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

View file

@ -0,0 +1,5 @@
class RenameGuidebooksToGuidebookIDs < ActiveRecord::Migration[7.0]
def change
rename_column :parties, :guidebooks, :guidebook_ids
end
end

View file

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

View file

@ -0,0 +1,5 @@
class RenameGuidebookColumns < ActiveRecord::Migration[7.0]
def change
rename_column :parties, :guidebook0_id, :guidebook3_id
end
end

View file

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

View file

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

View file

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

View file

@ -0,0 +1,5 @@
class MakeGachaDrawableIdUnique < ActiveRecord::Migration[7.0]
def change
add_index :gacha, :drawable_id, unique: true
end
end

View file

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

View file

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

View file

@ -0,0 +1,5 @@
class AddTargetMemoToSparks < ActiveRecord::Migration[7.0]
def change
add_column :sparks, :target_memo, :string
end
end

View file

@ -0,0 +1,5 @@
class MakeUserIdUniqueInSparks < ActiveRecord::Migration[7.0]
def change
add_index :sparks, :user_id, unique: true
end
end

View file

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

View file

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

View file

@ -0,0 +1,5 @@
class AddHlToRaidGroups < ActiveRecord::Migration[7.0]
def change
add_column :raid_groups, :hl, :boolean, default: true, null: false
end
end

View file

@ -0,0 +1,5 @@
class RemoveGroupIntegerFromRaids < ActiveRecord::Migration[7.0]
def change
remove_column :raids, :group, :integer
end
end

View file

@ -0,0 +1,5 @@
class AddGuidebooksToRaidGroups < ActiveRecord::Migration[7.0]
def change
add_column :raid_groups, :guidebooks, :boolean, default: false, null: false
end
end

View file

@ -0,0 +1,5 @@
class AddAutoSummonToParties < ActiveRecord::Migration[7.0]
def change
add_column :parties, :auto_summon, :boolean, default: false, null: false
end
end

View file

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