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

21 lines
594 B
Ruby

class CreateMashTournamentRounds < ActiveRecord::Migration
def self.up
create_table :mash_tournament_rounds do |t|
t.references :mash_tournament
t.integer :number, :null => false
t.integer :mash_count, :null => false
t.timestamps
end
add_index :mash_tournament_rounds, [:mash_tournament_id, :number]
add_index :mash_tournament_rounds, [:mash_count]
end
def self.down
remove_index :mash_tournament_rounds, [:mash_tournament_id, :number]
remove_index :mash_tournament_rounds, [:mash_count]
drop_table :mash_tournament_rounds
end
end