Re-namespacing a bit to clear out some fairly old stuff from the top level
This commit is contained in:
16
oldstuff/map-mash/db/migrate/20120304151123_create_maps.rb
Normal file
16
oldstuff/map-mash/db/migrate/20120304151123_create_maps.rb
Normal 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
|
22
oldstuff/map-mash/db/migrate/20120304164625_create_mashes.rb
Normal file
22
oldstuff/map-mash/db/migrate/20120304164625_create_mashes.rb
Normal 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
|
@@ -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
|
@@ -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
|
@@ -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
|
Reference in New Issue
Block a user