8ad33d18b7
bit closer on the tournament pairing algorithm (???) ActiveRecord associations are kind of a pain, btw.
22 lines
505 B
Ruby
22 lines
505 B
Ruby
class CreateMashes < ActiveRecord::Migration
|
|
def self.up
|
|
create_table :mashes do |t|
|
|
t.integer :requester_id, :null => false
|
|
t.integer :map_a_id, :null => false
|
|
t.integer :map_b_id, :null => false
|
|
t.integer :winner_id, :null => false
|
|
|
|
t.timestamps
|
|
end
|
|
|
|
add_index :mashes, [:winner_id]
|
|
add_index :mashes, [:requester_id]
|
|
end
|
|
|
|
def self.down
|
|
remove_index :mashes, [:winner_id]
|
|
remove_index :mashes, [:requester_id]
|
|
drop_table :mashes
|
|
end
|
|
end
|