ensl.org/db/migrate/20111217230345_add_ns2_maps.rb

28 lines
580 B
Ruby

class AddNs2Maps < ActiveRecord::Migration
def up
Gather.all.each do |g|
g.update_attribute :category_id, 44
end
change_table :servers do |s|
s.references :category
end
Server.all.each do |s|
s.update_attribute :category_id, 44
end
change_table :maps do |m|
m.references :category
end
Map.all.each do |s|
s.update_attribute :category_id, 44
end
end
def down
change_table :servers do |s|
s.remove :category_id
end
change_table :maps do |s|
s.remove :category_id
end
end
end