re-namespacing a touch

This commit is contained in:
Dan Buch
2012-04-03 23:02:32 -04:00
parent 62d2e11e31
commit 38c85ad7c7
122 changed files with 19625 additions and 0 deletions

View File

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

View File

@@ -0,0 +1,22 @@
class CreateMashes < ActiveRecord::Migration
def self.up
create_table :mashes do |t|
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
t.timestamps
end
add_index :mashes, [:winner_id]
add_index :mashes, [:mash_tournament_id]
end
def self.down
remove_index :mashes, [:winner_id]
remove_index :mashes, [:mash_tournament_id]
drop_table :mashes
end
end

View File

@@ -0,0 +1,13 @@
class CreateRequesters < ActiveRecord::Migration
def self.up
create_table :requesters do |t|
t.string :ip
t.timestamps
end
end
def self.down
drop_table :requesters
end
end

View File

@@ -0,0 +1,19 @@
class CreateMashTournaments < ActiveRecord::Migration
def self.up
create_table :mash_tournaments do |t|
t.references :requester, :null => false
t.integer :total_rounds, :default => 1
t.timestamps
end
add_index :mash_tournaments, [:requester_id]
add_index :mash_tournaments, [:total_rounds]
end
def self.down
remove_index :mash_tournaments, [:total_rounds]
remove_index :mash_tournaments, [:requester_id]
drop_table :mash_tournaments
end
end

View File

@@ -0,0 +1,20 @@
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