box-o-sand/map-mash/db/migrate/20120309130609_create_mash_tournaments.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

20 lines
498 B
Ruby

class CreateMashTournaments < ActiveRecord::Migration
def self.up
create_table :mash_tournaments do |t|
t.references :requester, :null => false
t.integer :total_rounds, :default => 1
t.timestamps
end
add_index :mash_tournaments, [:requester_id]
add_index :mash_tournaments, [:total_rounds]
end
def self.down
remove_index :mash_tournaments, [:total_rounds]
remove_index :mash_tournaments, [:requester_id]
drop_table :mash_tournaments
end
end