mirror of
https://github.com/ENSL/ensl.org.git
synced 2024-12-27 04:51:14 +00:00
28 lines
580 B
Ruby
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
|