A bit cleaner way of selecting map pairs, bunch of other cleanup crap generally characterized as removing generated Rails code

This commit is contained in:
Dan Buch
2012-03-07 23:43:32 -05:00
parent b31926f16f
commit d7f0f6c964
7 changed files with 54 additions and 147 deletions

View File

@@ -2,15 +2,18 @@ class CreateMaps < ActiveRecord::Migration
def self.up
create_table :maps do |t|
t.string :name, :null => false
t.integer :points, :default => 0
t.timestamps
end
add_index :maps, :name
add_index :maps, [:name]
add_index :maps, [:points]
end
def self.down
remove_index :maps, [:name]
remove_index :maps, [:points]
drop_table :maps
remove_index :maps, :name
end
end

View File

@@ -9,11 +9,13 @@ class CreateMashes < ActiveRecord::Migration
t.timestamps
end
add_index :mashes, :winner
add_index :mashes, [:winner]
add_index :mashes, [:requester]
end
def self.down
remove_index :mashes, [:winner]
remove_index :mashes, [:requester]
drop_table :mashes
remove_index :mashes, :winner
end
end