box-o-sand/rails/map-mash/db/migrate/20120304164625_create_mashes.rb

22 lines
480 B
Ruby

class CreateMashes < ActiveRecord::Migration
def self.up
create_table :mashes do |t|
t.string :requester, :null => false
t.integer :map_a, :null => false
t.integer :map_b, :null => false
t.integer :winner, :null => false
t.timestamps
end
add_index :mashes, [:winner]
add_index :mashes, [:requester]
end
def self.down
remove_index :mashes, [:winner]
remove_index :mashes, [:requester]
drop_table :mashes
end
end