1
0
Fork 0
dokkan-data-rails/db/migrate/20151109165630_add_cost_stat_to_card.rb
2015-11-09 12:11:53 -05:00

15 lines
306 B
Ruby

class AddCostStatToCard < ActiveRecord::Migration
def self.up
add_column :cards, :cost_stat_id, :integer
PaperTrail.whodunnit = 1
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