2015-11-09 12:11:53 -05:00
|
|
|
class AddCostStatToCard < ActiveRecord::Migration
|
|
|
|
def self.up
|
|
|
|
add_column :cards, :cost_stat_id, :integer
|
|
|
|
|
|
|
|
PaperTrail.whodunnit = 1
|
2015-11-09 12:23:04 -05:00
|
|
|
StatType.create(name: 'Cost', description: 'Cost')
|
2015-11-09 12:11:53 -05:00
|
|
|
Card.all.each do |c|
|
|
|
|
c.cost_stat = Stat.new(stat_type_id: 4)
|
|
|
|
c.save
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def self.down
|
|
|
|
remove_column :cards, :cost_stat_id
|
|
|
|
end
|
|
|
|
end
|