box-o-sand/map-mash/db/migrate/20120304164625_create_mashes.rb
Dan Buch d834b81003 Add 'map-mash/' from commit '7f16409d1257e7471fef35c18bcdf32856b908e3'
git-subtree-dir: map-mash
git-subtree-mainline: eacc351b17
git-subtree-split: 7f16409d12
2013-01-09 23:59:47 -05:00

23 lines
517 B
Ruby

class CreateMashes < ActiveRecord::Migration
def self.up
create_table :mashes do |t|
t.integer :mash_tournament_id, :null => false
t.integer :map_a_id
t.integer :map_b_id
t.integer :winner_id
t.integer :mash_tournament_round_id
t.timestamps
end
add_index :mashes, [:winner_id]
add_index :mashes, [:mash_tournament_id]
end
def self.down
remove_index :mashes, [:winner_id]
remove_index :mashes, [:mash_tournament_id]
drop_table :mashes
end
end