2012-03-09 13:06:25 +00:00
|
|
|
class CreateMashTournaments < ActiveRecord::Migration
|
|
|
|
def self.up
|
|
|
|
create_table :mash_tournaments do |t|
|
2012-03-09 13:11:54 +00:00
|
|
|
t.references :requester, :null => false
|
2012-03-10 13:47:47 +00:00
|
|
|
t.integer :total_rounds, :default => 1
|
2012-03-09 13:06:25 +00:00
|
|
|
|
|
|
|
t.timestamps
|
|
|
|
end
|
2012-03-09 13:11:54 +00:00
|
|
|
|
|
|
|
add_index :mash_tournaments, [:requester_id]
|
2012-03-10 13:47:47 +00:00
|
|
|
add_index :mash_tournaments, [:total_rounds]
|
2012-03-09 13:06:25 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def self.down
|
2012-03-10 13:47:47 +00:00
|
|
|
remove_index :mash_tournaments, [:total_rounds]
|
2012-03-09 13:11:54 +00:00
|
|
|
remove_index :mash_tournaments, [:requester_id]
|
2012-03-10 13:47:47 +00:00
|
|
|
drop_table :mash_tournaments
|
2012-03-09 13:06:25 +00:00
|
|
|
end
|
|
|
|
end
|