Squash migrations into one file

This commit is contained in:
Justin Edmund 2023-06-18 17:34:13 -07:00
parent ef6c887c33
commit 7f11be9d3c
140 changed files with 443 additions and 1142 deletions

View file

@ -66,12 +66,16 @@ end
group :development do group :development do
gem 'listen' gem 'listen'
gem 'rubocop'
gem 'solargraph' gem 'solargraph'
gem 'spring' gem 'spring'
gem 'spring-commands-rspec' gem 'spring-commands-rspec'
end end
group :tools do
gem 'squasher', '>= 0.6.0'
gem 'rubocop'
end
group :test do group :test do
gem 'api_matchers' gem 'api_matchers'
gem 'byebug' gem 'byebug'

View file

@ -293,6 +293,7 @@ GEM
actionpack (>= 5.2) actionpack (>= 5.2)
activesupport (>= 5.2) activesupport (>= 5.2)
sprockets (>= 3.0.0) sprockets (>= 3.0.0)
squasher (0.7.2)
stringio (3.0.4) stringio (3.0.4)
thor (1.2.1) thor (1.2.1)
tilt (2.0.11) tilt (2.0.11)
@ -349,6 +350,7 @@ DEPENDENCIES
spring spring
spring-commands-rspec spring-commands-rspec
sprockets-rails sprockets-rails
squasher (>= 0.6.0)
will_paginate (~> 3.3) will_paginate (~> 3.3)
RUBY VERSION RUBY VERSION

27
bin/squasher Executable file
View file

@ -0,0 +1,27 @@
#!/usr/bin/env ruby
# frozen_string_literal: true
#
# This file was generated by Bundler.
#
# The application 'squasher' is installed as part of a gem, and
# this file is here to facilitate running it.
#
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
bundle_binstub = File.expand_path("bundle", __dir__)
if File.file?(bundle_binstub)
if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
load(bundle_binstub)
else
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
end
end
require "rubygems"
require "bundler/setup"
load Gem.bin_path("squasher", "squasher")

View file

@ -1,5 +0,0 @@
class EnablePgcryptoExtension < ActiveRecord::Migration[5.0]
def change
enable_extension 'pgcrypto'
end
end

View file

@ -1,12 +0,0 @@
class CreateUsers < ActiveRecord::Migration[6.0]
def change
create_table :users, id: :uuid, default: -> { "gen_random_uuid()" } do |t|
t.string :email, :unique => true
t.string :password_digest
t.string :username, :unique => true
t.integer :granblue_id, :unique => true
t.timestamps
end
end
end

View file

@ -1,28 +0,0 @@
class CreateWeapons < ActiveRecord::Migration[6.0]
def change
create_table :weapons, id: :uuid, default: -> { "gen_random_uuid()" } do |t|
t.string :name_en
t.string :name_jp
t.string :granblue_id
t.integer :rarity
t.integer :element
t.integer :proficiency
t.string :series
t.boolean :flb
t.boolean :ulb
t.integer :max_level
t.integer :max_skill_level
t.integer :min_hp
t.integer :max_hp
t.integer :max_hp_flb
t.integer :max_hp_ulb
t.integer :min_atk
t.integer :max_atk
t.integer :max_atk_flb
t.integer :max_atk_ulb
end
end
end

View file

@ -1,11 +0,0 @@
class CreateParties < ActiveRecord::Migration[6.0]
def change
create_table :parties, id: :uuid, default: -> { "gen_random_uuid()" } do |t|
t.references :user, type: :uuid
t.string :shortcode
t.timestamps
end
end
end

View file

@ -1,17 +0,0 @@
class CreateGridWeapons < ActiveRecord::Migration[6.0]
def change
create_table :grid_weapons, id: :uuid, default: -> { "gen_random_uuid()" } do |t|
t.references :party, type: :uuid
t.references :weapon, type: :uuid
t.references :weapon_key1, class_name: 'WeaponKey', type: :uuid
t.references :weapon_key2, class_name: 'WeaponKey', type: :uuid
t.integer :uncap_level
t.boolean :mainhand
t.integer :position
t.timestamps
end
end
end

View file

@ -1,13 +0,0 @@
class CreateWeaponKeys < ActiveRecord::Migration[6.0]
def change
create_table :weapon_keys, id: :uuid, default: -> { "gen_random_uuid()" } do |t|
t.string :name_en
t.string :name_jp
t.integer :series
t.integer :type
t.timestamps
end
end
end

View file

@ -1,70 +0,0 @@
# frozen_string_literal: true
class CreateDoorkeeperTables < ActiveRecord::Migration[6.0]
def change
create_table :oauth_applications, id: :uuid do |t|
t.string :name, null: false
t.string :uid, null: false
t.string :secret, null: false
t.text :redirect_uri, null: false
t.string :scopes, null: false, default: ''
t.timestamps null: false
end
add_index :oauth_applications, :uid, unique: true
create_table :oauth_access_grants, id: :uuid do |t|
t.uuid :resource_owner_id, null: false
t.uuid :application_id, null: false
t.string :token, null: false
t.integer :expires_in, null: false
t.text :redirect_uri, null: false
t.datetime :created_at, null: false
t.datetime :revoked_at
t.string :scopes
end
add_index :oauth_access_grants, :token, unique: true
add_foreign_key(
:oauth_access_grants,
:oauth_applications,
column: :application_id
)
create_table :oauth_access_tokens, id: :uuid do |t|
t.uuid :resource_owner_id
t.uuid :application_id
# If you use a custom token generator you may need to change this column
# from string to text, so that it accepts tokens larger than 255
# characters. More info on custom token generators in:
# https://github.com/doorkeeper-gem/doorkeeper/tree/v3.0.0.rc1#custom-access-token-generator
#
# t.text :token, null: false
t.string :token, null: false
t.string :refresh_token
t.integer :expires_in
t.datetime :revoked_at
t.datetime :created_at, null: false
t.string :scopes
# If there is a previous_refresh_token column,
# refresh tokens will be revoked after a related access token is used.
# If there is no previous_refresh_token column,
# previous tokens are revoked as soon as a new access token is created.
# Comment out this line if you'd rather have refresh tokens
# instantly revoked.
t.string :previous_refresh_token, null: false, default: ""
end
add_index :oauth_access_tokens, :token, unique: true
add_index :oauth_access_tokens, :resource_owner_id
add_index :oauth_access_tokens, :refresh_token, unique: true
add_foreign_key(
:oauth_access_tokens,
:oauth_applications,
column: :application_id
)
end
end

View file

@ -1,26 +0,0 @@
class CreateSummons < ActiveRecord::Migration[6.0]
def change
create_table :summons, id: :uuid, default: -> { "gen_random_uuid()" } do |t|
t.string :name_en
t.string :name_jp
t.string :granblue_id
t.integer :rarity
t.integer :element
t.string :series
t.boolean :flb
t.boolean :ulb
t.integer :max_level
t.integer :min_hp
t.integer :max_hp
t.integer :max_hp_flb
t.integer :max_hp_ulb
t.integer :min_atk
t.integer :max_atk
t.integer :max_atk_flb
t.integer :max_atk_ulb
end
end
end

View file

@ -1,15 +0,0 @@
class CreateGridSummons < ActiveRecord::Migration[6.0]
def change
create_table :grid_summons, id: :uuid, default: -> { "gen_random_uuid()" } do |t|
t.references :party, type: :uuid
t.references :summon, type: :uuid
t.integer :uncap_level
t.boolean :main
t.boolean :friend
t.integer :position
t.timestamps
end
end
end

View file

@ -1,32 +0,0 @@
class CreateCharacters < ActiveRecord::Migration[6.0]
def change
create_table :characters, id: :uuid, default: -> { "gen_random_uuid()" } do |t|
t.string :name_en
t.string :name_jp
t.string :granblue_id
t.integer :rarity
t.integer :element
t.integer :proficiency1
t.integer :proficiency2
t.integer :gender
t.integer :race1
t.integer :race2
t.boolean :flb
t.boolean :max_level
t.integer :min_hp
t.integer :max_hp
t.integer :max_hp_flb
t.integer :min_atk
t.integer :max_atk
t.integer :max_atk_flb
t.integer :base_da
t.integer :base_ta
t.float :ougi_ratio
t.float :ougi_ratio_flb
end
end
end

View file

@ -1,13 +0,0 @@
class CreateGridCharacters < ActiveRecord::Migration[6.0]
def change
create_table :grid_characters do |t|
t.references :party, type: :uuid
t.references :character, type: :uuid
t.integer :uncap_level
t.integer :position
t.timestamps
end
end
end

View file

@ -1,5 +0,0 @@
class AddExtraToParty < ActiveRecord::Migration[6.1]
def change
add_column :parties, :extra, :boolean, :default => false, :null => false
end
end

View file

@ -1,5 +0,0 @@
class AddExtraToWeapons < ActiveRecord::Migration[6.1]
def change
add_column :weapons, :extra, :boolean, :default => false, :null => false
end
end

View file

@ -1,5 +0,0 @@
class AddSubauraToSummons < ActiveRecord::Migration[6.1]
def change
add_column :summons, :subaura, :boolean, :default => false, :null => false
end
end

View file

@ -1,5 +0,0 @@
class AddLimitsToWeapons < ActiveRecord::Migration[6.1]
def change
add_column :weapons, :limit, :integer
end
end

View file

@ -1,5 +0,0 @@
class AddLimitsToSummons < ActiveRecord::Migration[6.1]
def change
add_column :summons, :limit, :integer
end
end

View file

@ -1,13 +0,0 @@
class AddDefaultToLbOnWeapons < ActiveRecord::Migration[6.1]
def change
def self.up
change_column :weapons, :flb, :boolean, default: false
change_column :weapons, :ulb, :boolean, default: false
end
def self.down
change_column :weapons, :flb, :boolean, default: nil
change_column :weapons, :ulb, :boolean, default: nil
end
end
end

View file

@ -1,5 +0,0 @@
class AddAxToWeapons < ActiveRecord::Migration[6.1]
def change
add_column :weapons, :ax, :integer
end
end

View file

@ -1,10 +0,0 @@
class AddSpecialToCharacters < ActiveRecord::Migration[6.1]
def up
add_column :characters, :special, :boolean, :default => false
change_column_null :characters, :special, false
end
def down
remove_column :characters, :special, :boolean
end
end

View file

@ -1,15 +0,0 @@
class AddUlbToCharacters < ActiveRecord::Migration[6.1]
def up
add_column :characters, :ulb, :boolean, :default => false
add_column :characters, :max_hp_ulb, :integer
add_column :characters, :max_atk_ulb, :integer
change_column_null :characters, :ulb, false
change_column_null :characters, :flb, false
end
def down
remove_column :characters, :ulb, :boolean
remove_column :characters, :max_hp_ulb, :integer
remove_column :characters, :max_atk_ulb, :integer
end
end

View file

@ -1,5 +0,0 @@
class RemoveMaxLevelFromCharacters < ActiveRecord::Migration[6.1]
def change
remove_column :characters, :max_level, :boolean
end
end

View file

@ -1,5 +0,0 @@
class AddUuidToGridCharacter < ActiveRecord::Migration[6.1]
def change
add_column :grid_characters, :uuid, :uuid, default: "gen_random_uuid()", null: false
end
end

View file

@ -1,10 +0,0 @@
class ChangeGridCharacterIdToUuid < ActiveRecord::Migration[6.1]
def change
change_table :grid_characters do |t|
t.remove :id
t.rename :uuid, :id
end
execute "ALTER TABLE grid_characters ADD PRIMARY KEY (id);"
end
end

View file

@ -1,13 +0,0 @@
class AddDetailsToParty < ActiveRecord::Migration[6.1]
def change
create_table :raids, id: :uuid, default: -> { "gen_random_uuid()" } do |t|
t.string :name_en
t.string :name_jp
t.integer :level
end
add_column :parties, :name, :string
add_column :parties, :description, :text
add_reference :parties, :raids, index: true
end
end

View file

@ -1,5 +0,0 @@
class AddGroupToRaids < ActiveRecord::Migration[6.1]
def change
add_column :raids, :group, :integer
end
end

View file

@ -1,6 +0,0 @@
class FixRaidAssociationOnParties < ActiveRecord::Migration[6.1]
def change
add_column :parties, :raid_id, :uuid
remove_column :parties, :raids_id, :bigint
end
end

View file

@ -1,5 +0,0 @@
class AddElementToRaids < ActiveRecord::Migration[6.1]
def change
add_column :raids, :element, :integer
end
end

View file

@ -1,5 +0,0 @@
class AddElementToParties < ActiveRecord::Migration[6.1]
def change
add_column :parties, :element, :integer
end
end

View file

@ -1,9 +0,0 @@
class CreateFavorites < ActiveRecord::Migration[6.1]
def change
create_table :favorites, id: :uuid, default: -> { "gen_random_uuid()" } do |t|
t.references :user, type: :uuid
t.references :party, type: :uuid
t.timestamps
end
end
end

View file

@ -1,5 +0,0 @@
class ChangeWeaponSeriesToNumber < ActiveRecord::Migration[6.1]
def change
change_column :weapons, :series, 'integer USING CAST(element AS integer)'
end
end

View file

@ -1,6 +0,0 @@
class RemoveTimestampsFromWeaponKeys < ActiveRecord::Migration[6.1]
def change
remove_column :weapon_keys, :created_at, :datetime
remove_column :weapon_keys, :updated_at, :datetime
end
end

View file

@ -1,5 +0,0 @@
class AddSubTypeToWeaponKeys < ActiveRecord::Migration[6.1]
def change
add_column :weapon_keys, :subtype, :integer
end
end

View file

@ -1,5 +0,0 @@
class AddWeaponKey3ToGridWeapons < ActiveRecord::Migration[6.1]
def change
add_reference :grid_weapons, :weapon_key3, type: :uuid, foreign_key: { to_table: :weapon_keys }
end
end

View file

@ -1,8 +0,0 @@
class AddAxToGridWeapons < ActiveRecord::Migration[6.1]
def change
add_column :grid_weapons, :ax_modifier1, :integer
add_column :grid_weapons, :ax_strength1, :float
add_column :grid_weapons, :ax_modifier2, :integer
add_column :grid_weapons, :ax_strength2, :float
end
end

View file

@ -1,5 +0,0 @@
class AddElementToGridWeapons < ActiveRecord::Migration[6.1]
def change
add_column :grid_weapons, :element, :integer
end
end

View file

@ -1,5 +0,0 @@
class AddPerpetuityToGridCharacters < ActiveRecord::Migration[6.1]
def change
add_column :grid_characters, :perpetuity, :boolean
end
end

View file

@ -1,6 +0,0 @@
class RenameTypeAndSubTypeInWeaponKeys < ActiveRecord::Migration[6.1]
def change
rename_column :weapon_keys, :type, :slot
rename_column :weapon_keys, :subtype, :group
end
end

View file

@ -1,5 +0,0 @@
class AddOrderToWeaponKeys < ActiveRecord::Migration[6.1]
def change
add_column :weapon_keys, :order, :integer
end
end

View file

@ -1,7 +0,0 @@
class AddFieldsToUser < ActiveRecord::Migration[6.1]
def change
add_column :users, :picture, :string
add_column :users, :language, :string
add_column :users, :private, :boolean
end
end

View file

@ -1,7 +0,0 @@
class AddDefaultValuesToUser < ActiveRecord::Migration[6.1]
def change
change_column :users, :picture, :string, :default => "gran"
change_column :users, :language, :string, :default => "en"
change_column :users, :private, :boolean, :default => false
end
end

View file

@ -1,6 +0,0 @@
class AddNotNullableToUser < ActiveRecord::Migration[6.1]
def change
change_column :users, :language, :string, :default => "en", :null => false
change_column :users, :private, :boolean, :default => false, :null => false
end
end

View file

@ -1,5 +0,0 @@
class AddElementToUser < ActiveRecord::Migration[6.1]
def change
add_column :users, :element, :string, :default => "water", :null => false
end
end

View file

@ -1,5 +0,0 @@
class AddSlugToRaids < ActiveRecord::Migration[6.1]
def change
add_column :raids, :slug, :string
end
end

View file

@ -1,7 +0,0 @@
class AddGinIndexToWeapons < ActiveRecord::Migration[6.1]
def change
enable_extension "pg_trgm"
enable_extension "btree_gin"
add_index :weapons, :name_en, using: :gin, opclass: :gin_trgm_ops
end
end

View file

@ -1,6 +0,0 @@
class AddGinIndexToSummonsAndCharacters < ActiveRecord::Migration[6.1]
def change
add_index :summons, :name_en, using: :gin, opclass: :gin_trgm_ops
add_index :characters, :name_en, using: :gin, opclass: :gin_trgm_ops
end
end

View file

@ -1,5 +0,0 @@
class AddWeaponsCountToParties < ActiveRecord::Migration[6.1]
def change
add_column :parties, :weapons_count, :integer
end
end

View file

@ -1,7 +0,0 @@
class PopulatePartyWeaponsCount < ActiveRecord::Migration[6.1]
def up
Party.find_each do |party|
Party.reset_counters(party.id, :weapons)
end
end
end

View file

@ -1,14 +0,0 @@
class CreateClasses < ActiveRecord::Migration[6.0]
def change
create_table :classes, id: :uuid, default: -> { "gen_random_uuid()" } do |t|
t.string :name_en
t.string :name_jp
t.integer :proficiency1
t.integer :proficiency2
t.string :row
t.boolean :ml, default: false
end
end
end

View file

@ -1,6 +0,0 @@
class AddClassAndMlToParty < ActiveRecord::Migration[6.1]
def change
add_reference :parties, :class, name: :class_id, type: :uuid, foreign_key: { to_table: :classes }
add_column :parties, :ml, :integer
end
end

View file

@ -1,6 +0,0 @@
class AddForeignKeyRelationsToParties < ActiveRecord::Migration[6.1]
def change
add_foreign_key :parties, :users
add_foreign_key :parties, :raids
end
end

View file

@ -1,6 +0,0 @@
class AddForeignKeyRelationsToFavorites < ActiveRecord::Migration[6.1]
def change
add_foreign_key :favorites, :users
add_foreign_key :favorites, :parties
end
end

View file

@ -1,12 +0,0 @@
class AddForeignKeyRelationsToObjects < ActiveRecord::Migration[6.1]
def change
add_foreign_key :grid_characters, :parties
add_foreign_key :grid_characters, :characters
add_foreign_key :grid_weapons, :parties
add_foreign_key :grid_weapons, :weapons
add_foreign_key :grid_summons, :parties
add_foreign_key :grid_summons, :summons
end
end

View file

@ -1,14 +0,0 @@
class AddDefaultPerpetuityToGridCharacters < ActiveRecord::Migration[6.1]
def up
GridCharacter.find_each do |char|
char.perpetuity = false
char.save!
end
change_column :grid_characters, :perpetuity, :boolean, default: false, null: false
end
def down
end
end

View file

@ -1,9 +0,0 @@
class AddDefaultsToCharacters < ActiveRecord::Migration[6.1]
def up
change_column :characters, :flb, :boolean, default: false, null: false
end
def down
end
end

View file

@ -1,24 +0,0 @@
class AddDefaultsToWeapons < ActiveRecord::Migration[6.1]
def up
Weapon.find_each do |w|
if w.flb.nil?
w.flb = false
w.save!
end
if w.ulb.nil?
w.ulb = false
w.save!
end
end
change_column :weapons, :flb, :boolean, default: false, null: false
change_column :weapons, :ulb, :boolean, default: false, null: false
change_column :weapons, :ax, :integer, default: 0, null: false
change_column :weapons, :series, :integer, default: -1, null: false
end
def down
end
end

View file

@ -1,24 +0,0 @@
class AddDefaultsToSummons < ActiveRecord::Migration[6.1]
def change
def up
Summon.find_each do |s|
if s.flb.nil?
s.flb = false
s.save!
end
if s.ulb.nil?
s.ulb = false
s.save!
end
end
change_column :summons, :flb, :boolean, default: false, null: false
change_column :summons, :ulb, :boolean, default: false, null: false
end
def down
end
end
end

View file

@ -1,5 +0,0 @@
class ChangeClassesToJobs < ActiveRecord::Migration[6.1]
def change
rename_table :classes, :jobs
end
end

View file

@ -1,5 +0,0 @@
class RenameClassIdToJobId < ActiveRecord::Migration[6.1]
def change
rename_column :parties, :class_id, :job_id
end
end

View file

@ -1,5 +0,0 @@
class AddOrderToJobs < ActiveRecord::Migration[6.1]
def change
add_column :jobs, :order, :integer
end
end

View file

@ -1,5 +0,0 @@
class AddGenderToUser < ActiveRecord::Migration[6.1]
def change
add_column :users, :gender, :integer, null: false, default: 0
end
end

View file

@ -1,5 +0,0 @@
class AddCharacterIdToCharacters < ActiveRecord::Migration[6.1]
def change
add_column :characters, :character_id, :integer, array: true, null: false, default: []
end
end

View file

@ -1,14 +0,0 @@
class AddJobSkillsTable < ActiveRecord::Migration[6.1]
def change
create_table :job_skills, id: :uuid, default: -> { "gen_random_uuid()" } do |t|
t.references :job, type: :uuid
t.string :name_en, null: false, unique: true
t.string :name_jp, null: false, unique: true
t.string :slug, null: false, unique: true
t.integer :color, null: false
t.boolean :main, default: false
t.boolean :sub, default: false
t.boolean :emp, default: false
end
end
end

View file

@ -1,6 +0,0 @@
class RemoveNullConstraintFromJobSkills < ActiveRecord::Migration[6.1]
def change
change_column :job_skills, :name_en, :string, unique: false
change_column :job_skills, :name_jp, :string, unique: false
end
end

View file

@ -1,5 +0,0 @@
class AddOrderToJobSkills < ActiveRecord::Migration[6.1]
def change
add_column :job_skills, :order, :integer
end
end

View file

@ -1,6 +0,0 @@
class AddBaseAndGroupToJobSkills < ActiveRecord::Migration[6.1]
def change
add_column :job_skills, :base, :boolean, default: false
add_column :job_skills, :group, :integer
end
end

View file

@ -1,5 +0,0 @@
class RemoveGroupFromJobSkills < ActiveRecord::Migration[6.1]
def change
remove_column :job_skills, :group, :integer
end
end

View file

@ -1,9 +0,0 @@
class AddJobSkillsToParty < ActiveRecord::Migration[6.1]
def change
change_table(:parties) do |t|
t.references :skill1, type: :uuid, foreign_key: { to_table: 'job_skills' }
t.references :skill2, type: :uuid, foreign_key: { to_table: 'job_skills' }
t.references :skill3, type: :uuid, foreign_key: { to_table: 'job_skills' }
end
end
end

View file

@ -1,7 +0,0 @@
class AddSkill0ToParty < ActiveRecord::Migration[6.1]
def change
change_table(:parties) do |t|
t.references :skill0, type: :uuid, foreign_key: { to_table: "job_skills" }
end
end
end

View file

@ -1,7 +0,0 @@
class AddBaseJobToJobs < ActiveRecord::Migration[6.1]
def change
change_table(:jobs) do |t|
t.references :base_job, type: :uuid, foreign_key: { to_table: 'jobs' }
end
end
end

View file

@ -1,6 +0,0 @@
class AddAwakeningToGridWeapons < ActiveRecord::Migration[6.1]
def change
add_column :grid_weapons, :awakening_type, :integer, null: true
add_column :grid_weapons, :awakening_level, :integer, null: false, default: 1
end
end

View file

@ -1,6 +0,0 @@
class AddAwakeningToGridCharacters < ActiveRecord::Migration[6.1]
def change
add_column :grid_characters, :awakening_type, :integer, null: false, default: 0
add_column :grid_characters, :awakening_level, :integer, null: false, default: 1
end
end

View file

@ -1,5 +0,0 @@
class AddAwakeningToWeapons < ActiveRecord::Migration[6.1]
def change
add_column :weapons, :awakening, :boolean, null: false, default: true
end
end

View file

@ -1,5 +0,0 @@
class AddSlugToWeaponKeys < ActiveRecord::Migration[6.1]
def change
add_column :weapon_keys, :slug, :string
end
end

View file

@ -1,5 +0,0 @@
class AddThemeToUser < ActiveRecord::Migration[6.1]
def change
add_column :users, :theme, :string
end
end

View file

@ -1,5 +0,0 @@
class SetDefaultValueToTheme < ActiveRecord::Migration[6.1]
def change
change_column :users, :theme, :string, null: false, default: 'system'
end
end

View file

@ -1,6 +0,0 @@
class SetDefaultsOnWeapons < ActiveRecord::Migration[6.1]
def change
change_column :weapons, :max_level, :integer, null: false, default: 100
change_column :weapons, :max_skill_level, :integer, null: false, default: 10
end
end

View file

@ -1,6 +0,0 @@
class ChangeLimitToBoolean < ActiveRecord::Migration[6.1]
def change
add_column :weapons, :limit2, :boolean, default: false, null: false
add_column :summons, :limit2, :boolean, default: false, null: false
end
end

View file

@ -1,5 +0,0 @@
class RemoveLimitFromWeapons < ActiveRecord::Migration[6.1]
def change
remove_column :weapons, :limit, :integer
end
end

View file

@ -1,5 +0,0 @@
class RenameLimit2OnWeapon < ActiveRecord::Migration[6.1]
def change
rename_column :weapons, :limit2, :limit
end
end

View file

@ -1,5 +0,0 @@
class RemoveLimitFromSummons < ActiveRecord::Migration[6.1]
def change
remove_column :summons, :limit, :integer
end
end

View file

@ -1,5 +0,0 @@
class RenameLimit2OnSummons < ActiveRecord::Migration[6.1]
def change
rename_column :summons, :limit2, :limit
end
end

View file

@ -1,5 +0,0 @@
class RenameAxToAxTypeOnWeapons < ActiveRecord::Migration[6.1]
def change
rename_column :weapons, :ax, :ax_type
end
end

View file

@ -1,5 +0,0 @@
class AddBooleanAxToWeapons < ActiveRecord::Migration[6.1]
def change
add_column :weapons, :ax, :boolean
end
end

View file

@ -1,6 +0,0 @@
class ChangeAxAxTypeProperties < ActiveRecord::Migration[6.1]
def change
change_column :weapons, :ax, :boolean, null: false, default: false
change_column :weapons, :ax_type, :integer, null: true, default: nil
end
end

View file

@ -1,5 +0,0 @@
class AddXlbToSummons < ActiveRecord::Migration[6.1]
def change
add_column :summons, :xlb, :boolean, default: false, null: false
end
end

View file

@ -1,7 +0,0 @@
class SetDefaultsOnSummons < ActiveRecord::Migration[6.1]
def change
change_column :summons, :flb, :boolean, null: false, default: false
change_column :summons, :ulb, :boolean, null: false, default: false
change_column :summons, :max_level, :integer, null: false, default: 100
end
end

View file

@ -1,5 +0,0 @@
class AddTranscendenceStepToGridCharacters < ActiveRecord::Migration[6.1]
def change
add_column :grid_characters, :transcendence_step, :integer, default: 0, null: false
end
end

View file

@ -1,5 +0,0 @@
class AddTranscendenceStepToGridSummons < ActiveRecord::Migration[6.1]
def change
add_column :grid_summons, :transcendence_step, :integer, default: 0, null: false
end
end

View file

@ -1,18 +0,0 @@
class AddRingsEarringsToGridCharacters < ActiveRecord::Migration[6.1]
def change
add_column :grid_characters, :ring_modifier1, :integer
add_column :grid_characters, :ring_strength1, :float
add_column :grid_characters, :ring_modifier2, :integer
add_column :grid_characters, :ring_strength2, :float
add_column :grid_characters, :ring_modifier3, :integer
add_column :grid_characters, :ring_strength3, :float
add_column :grid_characters, :ring_modifier4, :integer
add_column :grid_characters, :ring_strength4, :float
add_column :grid_characters, :earring_modifier, :integer
add_column :grid_characters, :earring_strength, :float
end
end

View file

@ -1,12 +0,0 @@
class AddNewPartyDetails < ActiveRecord::Migration[7.0]
def change
add_column :parties, :full_auto, :boolean, default: false, null: false
add_column :parties, :auto_guard, :boolean, default: false, null: false
add_column :parties, :charge_attack, :boolean, default: false, null: false
add_column :parties, :clear_time, :integer, default: 0, null: false
add_column :parties, :button_count, :integer, default: 0, null: false
add_column :parties, :chain_count, :integer, default: 0, null: false
add_column :parties, :turn_count, :integer, default: 0, null: false
end
end

View file

@ -1,5 +0,0 @@
class UpdateTurnCountDefault < ActiveRecord::Migration[7.0]
def change
change_column :parties, :turn_count, :integer, null: false, default: 1
end
end

View file

@ -1,7 +0,0 @@
class UpdateNullableOnPartyDetails < ActiveRecord::Migration[7.0]
def change
change_column :parties, :button_count, :integer, null: true, default: nil
change_column :parties, :chain_count, :integer, null: true, default: nil
change_column :parties, :turn_count, :integer, null: true, default: nil
end
end

View file

@ -1,5 +0,0 @@
class ChangeDefaultValueOnChargeAttack < ActiveRecord::Migration[7.0]
def change
change_column :parties, :charge_attack, :boolean, null: false, default: true
end
end

View file

@ -1,5 +0,0 @@
class ChangeAwakeningTypeDefaultValue < ActiveRecord::Migration[7.0]
def change
change_column :grid_characters, :awakening_type, :integer, null: false, default: 1
end
end

View file

@ -1,22 +0,0 @@
class ChangeMasteryColumnsToJsonb < ActiveRecord::Migration[7.0]
def change
# Remove old columns
remove_column :grid_characters, :ring_modifier1, :integer
remove_column :grid_characters, :ring_modifier2, :integer
remove_column :grid_characters, :ring_modifier3, :integer
remove_column :grid_characters, :ring_modifier4, :integer
remove_column :grid_characters, :ring_strength1, :integer
remove_column :grid_characters, :ring_strength2, :integer
remove_column :grid_characters, :ring_strength3, :integer
remove_column :grid_characters, :ring_strength4, :integer
remove_column :grid_characters, :earring_modifier, :integer
remove_column :grid_characters, :earring_strength, :integer
# Add new columns
add_column :grid_characters, :ring1, :jsonb, default: { modifier: nil, strength: nil }
add_column :grid_characters, :ring2, :jsonb, default: { modifier: nil, strength: nil }
add_column :grid_characters, :ring3, :jsonb, default: { modifier: nil, strength: nil }
add_column :grid_characters, :ring4, :jsonb, default: { modifier: nil, strength: nil }
add_column :grid_characters, :earring, :jsonb, default: { modifier: nil, strength: nil }
end
end

View file

@ -1,10 +0,0 @@
class ChangeAwakeningColumnsToJsonb < ActiveRecord::Migration[7.0]
def change
# Remove old columns
remove_column :grid_characters, :awakening_type, :integer
remove_column :grid_characters, :awakening_level, :integer
# Add new column
add_column :grid_characters, :awakening, :jsonb, default: { type: 1, level: 1 }
end
end

View file

@ -1,10 +0,0 @@
class MakeMasteryColumnsNotNullable < ActiveRecord::Migration[7.0]
def change
change_column :grid_characters, :ring1, :jsonb, null: false
change_column :grid_characters, :ring2, :jsonb, null: false
change_column :grid_characters, :ring3, :jsonb, null: false
change_column :grid_characters, :ring4, :jsonb, null: false
change_column :grid_characters, :earring, :jsonb, null: false
change_column :grid_characters, :awakening, :jsonb, null: false
end
end

Some files were not shown because too many files have changed in this diff Show more