summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorguntasgrewal <guntasgrewal@gmail.com>2014-03-06 17:34:41 -0500
committerguntasgrewal <guntasgrewal@gmail.com>2014-03-06 17:34:41 -0500
commit0e8af95b4656d851cc43b45f8c48fd2c4d4c1ed2 (patch)
tree263f0e970f8ce981470e591d94d14700810d7853 /db
parent240d8602fb6aaf249b33db7b0c2f8a72add63658 (diff)
parentf5d36fc67d1994b7cc1ce02e7be2767ffcb47857 (diff)
merge ready?
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20140306024709_create_tournaments.rb9
-rw-r--r--db/migrate/20140306024720_create_games.rb13
-rw-r--r--db/migrate/20140306024727_create_game_attributes.rb11
-rw-r--r--db/migrate/20140306222309_create_servers.rb (renamed from db/migrate/20140306024707_create_servers.rb)0
-rw-r--r--db/migrate/20140306222314_create_tournaments.rb16
-rw-r--r--db/migrate/20140306222320_create_matches.rb (renamed from db/migrate/20140306024711_create_matches.rb)0
-rw-r--r--db/migrate/20140306222325_create_teams.rb (renamed from db/migrate/20140306024713_create_teams.rb)1
-rw-r--r--db/migrate/20140306222330_create_alerts.rb (renamed from db/migrate/20140306024715_create_alerts.rb)0
-rw-r--r--db/migrate/20140306222336_create_pms.rb (renamed from db/migrate/20140306024718_create_pms.rb)0
-rw-r--r--db/migrate/20140306222341_create_games.rb15
-rw-r--r--db/migrate/20140306222347_create_users.rb (renamed from db/migrate/20140306024722_create_users.rb)0
-rw-r--r--db/migrate/20140306222352_create_sessions.rb (renamed from db/migrate/20140306024724_create_sessions.rb)0
-rw-r--r--db/migrate/20140306222357_create_server_settings.rb (renamed from db/migrate/20140306024729_create_server_settings.rb)0
-rw-r--r--db/migrate/20140306222402_create_tournament_options.rb (renamed from db/migrate/20140306024735_create_tournament_options.rb)4
-rw-r--r--db/migrate/20140306222407_create_game_options.rb11
-rw-r--r--db/migrate/20140306222412_create_scores.rb11
-rw-r--r--db/migrate/20140306222417_create_tournament_user_pairs.rb10
-rw-r--r--db/migrate/20140306222422_create_user_team_pairs.rb (renamed from db/migrate/20140306024731_create_user_team_pairs.rb)0
-rw-r--r--db/migrate/20140306222427_create_team_match_pairs.rb (renamed from db/migrate/20140306024733_create_team_match_pairs.rb)0
-rw-r--r--db/migrate/20140306222447_add_hidden_attrs_to_user.rb (renamed from db/migrate/20140306024744_add_hidden_attrs_to_user.rb)0
-rw-r--r--db/schema.rb57
21 files changed, 115 insertions, 43 deletions
diff --git a/db/migrate/20140306024709_create_tournaments.rb b/db/migrate/20140306024709_create_tournaments.rb
deleted file mode 100644
index 36fcf7e..0000000
--- a/db/migrate/20140306024709_create_tournaments.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-class CreateTournaments < ActiveRecord::Migration
- def change
- create_table :tournaments do |t|
- t.references :game, index: true
-
- t.timestamps
- end
- end
-end
diff --git a/db/migrate/20140306024720_create_games.rb b/db/migrate/20140306024720_create_games.rb
deleted file mode 100644
index 59d4ef0..0000000
--- a/db/migrate/20140306024720_create_games.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-class CreateGames < ActiveRecord::Migration
- def change
- create_table :games do |t|
- t.text :name
- t.integer :players_per_team
- t.integer :teams_per_match
- t.integer :set_rounds
- t.integer :randomized_teams
-
- t.timestamps
- end
- end
-end
diff --git a/db/migrate/20140306024727_create_game_attributes.rb b/db/migrate/20140306024727_create_game_attributes.rb
deleted file mode 100644
index b63f134..0000000
--- a/db/migrate/20140306024727_create_game_attributes.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-class CreateGameAttributes < ActiveRecord::Migration
- def change
- create_table :game_attributes do |t|
- t.references :game, index: true
- t.text :key
- t.integer :type
-
- t.timestamps
- end
- end
-end
diff --git a/db/migrate/20140306024707_create_servers.rb b/db/migrate/20140306222309_create_servers.rb
index f33241a..f33241a 100644
--- a/db/migrate/20140306024707_create_servers.rb
+++ b/db/migrate/20140306222309_create_servers.rb
diff --git a/db/migrate/20140306222314_create_tournaments.rb b/db/migrate/20140306222314_create_tournaments.rb
new file mode 100644
index 0000000..c7ec765
--- /dev/null
+++ b/db/migrate/20140306222314_create_tournaments.rb
@@ -0,0 +1,16 @@
+class CreateTournaments < ActiveRecord::Migration
+ def change
+ create_table :tournaments do |t|
+ t.references :game, index: true
+ t.integer :min_players_per_team
+ t.integer :max_players_per_team
+ t.integer :min_teams_per_match
+ t.integer :max_teams_per_match
+ t.integer :set_rounds
+ t.boolean :randomized_teams
+ t.integer :status
+
+ t.timestamps
+ end
+ end
+end
diff --git a/db/migrate/20140306024711_create_matches.rb b/db/migrate/20140306222320_create_matches.rb
index 325863d..325863d 100644
--- a/db/migrate/20140306024711_create_matches.rb
+++ b/db/migrate/20140306222320_create_matches.rb
diff --git a/db/migrate/20140306024713_create_teams.rb b/db/migrate/20140306222325_create_teams.rb
index dd8397d..fdf9a68 100644
--- a/db/migrate/20140306024713_create_teams.rb
+++ b/db/migrate/20140306222325_create_teams.rb
@@ -1,6 +1,7 @@
class CreateTeams < ActiveRecord::Migration
def change
create_table :teams do |t|
+ t.references :match, index: true
t.timestamps
end
diff --git a/db/migrate/20140306024715_create_alerts.rb b/db/migrate/20140306222330_create_alerts.rb
index 68a8e10..68a8e10 100644
--- a/db/migrate/20140306024715_create_alerts.rb
+++ b/db/migrate/20140306222330_create_alerts.rb
diff --git a/db/migrate/20140306024718_create_pms.rb b/db/migrate/20140306222336_create_pms.rb
index 93bb5c6..93bb5c6 100644
--- a/db/migrate/20140306024718_create_pms.rb
+++ b/db/migrate/20140306222336_create_pms.rb
diff --git a/db/migrate/20140306222341_create_games.rb b/db/migrate/20140306222341_create_games.rb
new file mode 100644
index 0000000..5e4f56f
--- /dev/null
+++ b/db/migrate/20140306222341_create_games.rb
@@ -0,0 +1,15 @@
+class CreateGames < ActiveRecord::Migration
+ def change
+ create_table :games do |t|
+ t.text :name
+ t.integer :min_players_per_team
+ t.integer :max_players_per_team
+ t.integer :min_teams_per_match
+ t.integer :max_teams_per_match
+ t.integer :set_rounds
+ t.boolean :randomized_teams
+
+ t.timestamps
+ end
+ end
+end
diff --git a/db/migrate/20140306024722_create_users.rb b/db/migrate/20140306222347_create_users.rb
index 8032870..8032870 100644
--- a/db/migrate/20140306024722_create_users.rb
+++ b/db/migrate/20140306222347_create_users.rb
diff --git a/db/migrate/20140306024724_create_sessions.rb b/db/migrate/20140306222352_create_sessions.rb
index fe25bf2..fe25bf2 100644
--- a/db/migrate/20140306024724_create_sessions.rb
+++ b/db/migrate/20140306222352_create_sessions.rb
diff --git a/db/migrate/20140306024729_create_server_settings.rb b/db/migrate/20140306222357_create_server_settings.rb
index dfdd91b..dfdd91b 100644
--- a/db/migrate/20140306024729_create_server_settings.rb
+++ b/db/migrate/20140306222357_create_server_settings.rb
diff --git a/db/migrate/20140306024735_create_tournament_options.rb b/db/migrate/20140306222402_create_tournament_options.rb
index d2df22e..53b601c 100644
--- a/db/migrate/20140306024735_create_tournament_options.rb
+++ b/db/migrate/20140306222402_create_tournament_options.rb
@@ -1,6 +1,10 @@
class CreateTournamentOptions < ActiveRecord::Migration
def change
create_table :tournament_options do |t|
+ t.references :tournament, index: true
+ t.integer :vartype
+ t.string :name
+ t.text :value
t.timestamps
end
diff --git a/db/migrate/20140306222407_create_game_options.rb b/db/migrate/20140306222407_create_game_options.rb
new file mode 100644
index 0000000..2f62ef7
--- /dev/null
+++ b/db/migrate/20140306222407_create_game_options.rb
@@ -0,0 +1,11 @@
+class CreateGameOptions < ActiveRecord::Migration
+ def change
+ create_table :game_options do |t|
+ t.integer :vartype
+ t.string :name
+ t.text :default
+
+ t.timestamps
+ end
+ end
+end
diff --git a/db/migrate/20140306222412_create_scores.rb b/db/migrate/20140306222412_create_scores.rb
new file mode 100644
index 0000000..4ca0b0b
--- /dev/null
+++ b/db/migrate/20140306222412_create_scores.rb
@@ -0,0 +1,11 @@
+class CreateScores < ActiveRecord::Migration
+ def change
+ create_table :scores do |t|
+ t.references :user, index: true
+ t.references :match, index: true
+ t.integer :value
+
+ t.timestamps
+ end
+ end
+end
diff --git a/db/migrate/20140306222417_create_tournament_user_pairs.rb b/db/migrate/20140306222417_create_tournament_user_pairs.rb
new file mode 100644
index 0000000..ab72aad
--- /dev/null
+++ b/db/migrate/20140306222417_create_tournament_user_pairs.rb
@@ -0,0 +1,10 @@
+class CreateTournamentUserPairs < ActiveRecord::Migration
+ def change
+ create_table :tournament_user_pairs do |t|
+ t.references :tournament, index: true
+ t.references :user, index: true
+
+ t.timestamps
+ end
+ end
+end
diff --git a/db/migrate/20140306024731_create_user_team_pairs.rb b/db/migrate/20140306222422_create_user_team_pairs.rb
index 2c492ac..2c492ac 100644
--- a/db/migrate/20140306024731_create_user_team_pairs.rb
+++ b/db/migrate/20140306222422_create_user_team_pairs.rb
diff --git a/db/migrate/20140306024733_create_team_match_pairs.rb b/db/migrate/20140306222427_create_team_match_pairs.rb
index 8fac07e..8fac07e 100644
--- a/db/migrate/20140306024733_create_team_match_pairs.rb
+++ b/db/migrate/20140306222427_create_team_match_pairs.rb
diff --git a/db/migrate/20140306024744_add_hidden_attrs_to_user.rb b/db/migrate/20140306222447_add_hidden_attrs_to_user.rb
index 2f1b0b2..2f1b0b2 100644
--- a/db/migrate/20140306024744_add_hidden_attrs_to_user.rb
+++ b/db/migrate/20140306222447_add_hidden_attrs_to_user.rb
diff --git a/db/schema.rb b/db/schema.rb
index b0d0766..eadf24e 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.
-ActiveRecord::Schema.define(version: 20140306024744) do
+ActiveRecord::Schema.define(version: 20140306222447) do
create_table "alerts", force: true do |t|
t.integer "author_id"
@@ -22,22 +22,22 @@ ActiveRecord::Schema.define(version: 20140306024744) do
add_index "alerts", ["author_id"], name: "index_alerts_on_author_id"
- create_table "game_attributes", force: true do |t|
- t.integer "game_id"
- t.text "key"
- t.integer "type"
+ create_table "game_options", force: true do |t|
+ t.integer "vartype"
+ t.string "name"
+ t.text "default"
t.datetime "created_at"
t.datetime "updated_at"
end
- add_index "game_attributes", ["game_id"], name: "index_game_attributes_on_game_id"
-
create_table "games", force: true do |t|
t.text "name"
- t.integer "players_per_team"
- t.integer "teams_per_match"
+ t.integer "min_players_per_team"
+ t.integer "max_players_per_team"
+ t.integer "min_teams_per_match"
+ t.integer "max_teams_per_match"
t.integer "set_rounds"
- t.integer "randomized_teams"
+ t.boolean "randomized_teams"
t.datetime "created_at"
t.datetime "updated_at"
end
@@ -62,6 +62,17 @@ ActiveRecord::Schema.define(version: 20140306024744) do
add_index "pms", ["author_id"], name: "index_pms_on_author_id"
add_index "pms", ["recipient_id"], name: "index_pms_on_recipient_id"
+ create_table "scores", force: true do |t|
+ t.integer "user_id"
+ t.integer "match_id"
+ t.integer "value"
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ end
+
+ add_index "scores", ["match_id"], name: "index_scores_on_match_id"
+ add_index "scores", ["user_id"], name: "index_scores_on_user_id"
+
create_table "server_settings", force: true do |t|
t.datetime "created_at"
t.datetime "updated_at"
@@ -91,17 +102,43 @@ ActiveRecord::Schema.define(version: 20140306024744) do
add_index "team_match_pairs", ["team_id"], name: "index_team_match_pairs_on_team_id"
create_table "teams", force: true do |t|
+ t.integer "match_id"
t.datetime "created_at"
t.datetime "updated_at"
end
+ add_index "teams", ["match_id"], name: "index_teams_on_match_id"
+
create_table "tournament_options", force: true do |t|
+ t.integer "tournament_id"
+ t.integer "vartype"
+ t.string "name"
+ t.text "value"
t.datetime "created_at"
t.datetime "updated_at"
end
+ add_index "tournament_options", ["tournament_id"], name: "index_tournament_options_on_tournament_id"
+
+ create_table "tournament_user_pairs", force: true do |t|
+ t.integer "tournament_id"
+ t.integer "user_id"
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ end
+
+ add_index "tournament_user_pairs", ["tournament_id"], name: "index_tournament_user_pairs_on_tournament_id"
+ add_index "tournament_user_pairs", ["user_id"], name: "index_tournament_user_pairs_on_user_id"
+
create_table "tournaments", force: true do |t|
t.integer "game_id"
+ t.integer "min_players_per_team"
+ t.integer "max_players_per_team"
+ t.integer "min_teams_per_match"
+ t.integer "max_teams_per_match"
+ t.integer "set_rounds"
+ t.boolean "randomized_teams"
+ t.integer "status"
t.datetime "created_at"
t.datetime "updated_at"
end