Summon FLB, ULB and max_level don't have defaults and can be null, which is bad
21 lines
379 B
Ruby
21 lines
379 B
Ruby
# frozen_string_literal: true
|
|
|
|
class SetFlbToFalseOnSummons < ActiveRecord::Migration[6.1]
|
|
def up
|
|
Summon.all.each do |summon|
|
|
if summon.flb.nil?
|
|
summon.flb = false
|
|
summon.save
|
|
end
|
|
|
|
if summon.ulb.nil?
|
|
summon.ulb = false
|
|
summon.save
|
|
end
|
|
end
|
|
end
|
|
|
|
def down
|
|
raise ActiveRecord::IrreversibleMigration
|
|
end
|
|
end
|