2012-03-04 16:51:35 +00:00
|
|
|
class CreateMashes < ActiveRecord::Migration
|
|
|
|
def self.up
|
|
|
|
create_table :mashes do |t|
|
2012-03-10 13:47:47 +00:00
|
|
|
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
|
2012-03-04 16:51:35 +00:00
|
|
|
|
|
|
|
t.timestamps
|
|
|
|
end
|
2012-03-08 02:22:35 +00:00
|
|
|
|
2012-03-09 05:24:48 +00:00
|
|
|
add_index :mashes, [:winner_id]
|
2012-03-10 13:47:47 +00:00
|
|
|
add_index :mashes, [:mash_tournament_id]
|
2012-03-04 16:51:35 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def self.down
|
2012-03-09 05:24:48 +00:00
|
|
|
remove_index :mashes, [:winner_id]
|
2012-03-10 13:47:47 +00:00
|
|
|
remove_index :mashes, [:mash_tournament_id]
|
2012-03-04 16:51:35 +00:00
|
|
|
drop_table :mashes
|
|
|
|
end
|
|
|
|
end
|