summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20140306202156_create_tournaments.rb9
-rw-r--r--db/migrate/20140306202207_create_games.rb13
-rw-r--r--db/migrate/20140306202213_create_game_attributes.rb11
-rw-r--r--db/migrate/20140307003703_create_teams.rb (renamed from db/migrate/20140306202200_create_teams.rb)1
-rw-r--r--db/migrate/20140307003709_create_alerts.rb (renamed from db/migrate/20140306202202_create_alerts.rb)0
-rw-r--r--db/migrate/20140307003714_create_pms.rb (renamed from db/migrate/20140306202204_create_pms.rb)0
-rw-r--r--db/migrate/20140307003719_create_tournaments.rb16
-rw-r--r--db/migrate/20140307003926_create_servers.rb (renamed from db/migrate/20140306202154_create_servers.rb)0
-rw-r--r--db/migrate/20140307003931_create_matches.rb (renamed from db/migrate/20140306202158_create_matches.rb)0
-rw-r--r--db/migrate/20140307003956_create_games.rb15
-rw-r--r--db/migrate/20140307004001_create_users.rb (renamed from db/migrate/20140306202209_create_users.rb)0
-rw-r--r--db/migrate/20140307004006_create_sessions.rb (renamed from db/migrate/20140306202211_create_sessions.rb)0
-rw-r--r--db/migrate/20140307004011_create_server_settings.rb (renamed from db/migrate/20140306202215_create_server_settings.rb)0
-rw-r--r--db/migrate/20140307004016_create_tournament_options.rb (renamed from db/migrate/20140306202217_create_tournament_options.rb)4
-rw-r--r--db/migrate/20140307004021_create_game_options.rb11
-rw-r--r--db/migrate/20140307004027_create_scores.rb11
-rw-r--r--db/migrate/20140307004031_create_user_team_pairs.rb (renamed from db/migrate/20140306202219_create_user_team_pairs.rb)0
-rw-r--r--db/migrate/20140307004036_create_user_tournament_pairs.rb (renamed from db/migrate/20140306202222_create_user_tournament_pairs.rb)0
-rw-r--r--db/migrate/20140307004041_create_team_match_pairs.rb (renamed from db/migrate/20140306202224_create_team_match_pairs.rb)0
-rw-r--r--db/migrate/20140307004100_add_hidden_attrs_to_user.rb (renamed from db/migrate/20140306202232_add_hidden_attrs_to_user.rb)0
-rw-r--r--db/schema.rb47
21 files changed, 95 insertions, 43 deletions
diff --git a/db/migrate/20140306202156_create_tournaments.rb b/db/migrate/20140306202156_create_tournaments.rb
deleted file mode 100644
index 36fcf7e..0000000
--- a/db/migrate/20140306202156_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/20140306202207_create_games.rb b/db/migrate/20140306202207_create_games.rb
deleted file mode 100644
index 59d4ef0..0000000
--- a/db/migrate/20140306202207_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/20140306202213_create_game_attributes.rb b/db/migrate/20140306202213_create_game_attributes.rb
deleted file mode 100644
index b63f134..0000000
--- a/db/migrate/20140306202213_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/20140306202200_create_teams.rb b/db/migrate/20140307003703_create_teams.rb
index dd8397d..fdf9a68 100644
--- a/db/migrate/20140306202200_create_teams.rb
+++ b/db/migrate/20140307003703_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/20140306202202_create_alerts.rb b/db/migrate/20140307003709_create_alerts.rb
index 68a8e10..68a8e10 100644
--- a/db/migrate/20140306202202_create_alerts.rb
+++ b/db/migrate/20140307003709_create_alerts.rb
diff --git a/db/migrate/20140306202204_create_pms.rb b/db/migrate/20140307003714_create_pms.rb
index 93bb5c6..93bb5c6 100644
--- a/db/migrate/20140306202204_create_pms.rb
+++ b/db/migrate/20140307003714_create_pms.rb
diff --git a/db/migrate/20140307003719_create_tournaments.rb b/db/migrate/20140307003719_create_tournaments.rb
new file mode 100644
index 0000000..545e603
--- /dev/null
+++ b/db/migrate/20140307003719_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 :status
+ 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/20140306202154_create_servers.rb b/db/migrate/20140307003926_create_servers.rb
index f33241a..f33241a 100644
--- a/db/migrate/20140306202154_create_servers.rb
+++ b/db/migrate/20140307003926_create_servers.rb
diff --git a/db/migrate/20140306202158_create_matches.rb b/db/migrate/20140307003931_create_matches.rb
index 325863d..325863d 100644
--- a/db/migrate/20140306202158_create_matches.rb
+++ b/db/migrate/20140307003931_create_matches.rb
diff --git a/db/migrate/20140307003956_create_games.rb b/db/migrate/20140307003956_create_games.rb
new file mode 100644
index 0000000..5e4f56f
--- /dev/null
+++ b/db/migrate/20140307003956_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/20140306202209_create_users.rb b/db/migrate/20140307004001_create_users.rb
index 8032870..8032870 100644
--- a/db/migrate/20140306202209_create_users.rb
+++ b/db/migrate/20140307004001_create_users.rb
diff --git a/db/migrate/20140306202211_create_sessions.rb b/db/migrate/20140307004006_create_sessions.rb
index fe25bf2..fe25bf2 100644
--- a/db/migrate/20140306202211_create_sessions.rb
+++ b/db/migrate/20140307004006_create_sessions.rb
diff --git a/db/migrate/20140306202215_create_server_settings.rb b/db/migrate/20140307004011_create_server_settings.rb
index dfdd91b..dfdd91b 100644
--- a/db/migrate/20140306202215_create_server_settings.rb
+++ b/db/migrate/20140307004011_create_server_settings.rb
diff --git a/db/migrate/20140306202217_create_tournament_options.rb b/db/migrate/20140307004016_create_tournament_options.rb
index d2df22e..53b601c 100644
--- a/db/migrate/20140306202217_create_tournament_options.rb
+++ b/db/migrate/20140307004016_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/20140307004021_create_game_options.rb b/db/migrate/20140307004021_create_game_options.rb
new file mode 100644
index 0000000..2f62ef7
--- /dev/null
+++ b/db/migrate/20140307004021_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/20140307004027_create_scores.rb b/db/migrate/20140307004027_create_scores.rb
new file mode 100644
index 0000000..4ca0b0b
--- /dev/null
+++ b/db/migrate/20140307004027_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/20140306202219_create_user_team_pairs.rb b/db/migrate/20140307004031_create_user_team_pairs.rb
index 2c492ac..2c492ac 100644
--- a/db/migrate/20140306202219_create_user_team_pairs.rb
+++ b/db/migrate/20140307004031_create_user_team_pairs.rb
diff --git a/db/migrate/20140306202222_create_user_tournament_pairs.rb b/db/migrate/20140307004036_create_user_tournament_pairs.rb
index 9885b20..9885b20 100644
--- a/db/migrate/20140306202222_create_user_tournament_pairs.rb
+++ b/db/migrate/20140307004036_create_user_tournament_pairs.rb
diff --git a/db/migrate/20140306202224_create_team_match_pairs.rb b/db/migrate/20140307004041_create_team_match_pairs.rb
index 8fac07e..8fac07e 100644
--- a/db/migrate/20140306202224_create_team_match_pairs.rb
+++ b/db/migrate/20140307004041_create_team_match_pairs.rb
diff --git a/db/migrate/20140306202232_add_hidden_attrs_to_user.rb b/db/migrate/20140307004100_add_hidden_attrs_to_user.rb
index 2f1b0b2..2f1b0b2 100644
--- a/db/migrate/20140306202232_add_hidden_attrs_to_user.rb
+++ b/db/migrate/20140307004100_add_hidden_attrs_to_user.rb
diff --git a/db/schema.rb b/db/schema.rb
index 3a0ce17..cae1815 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: 20140306202232) do
+ActiveRecord::Schema.define(version: 20140307004100) do
create_table "alerts", force: true do |t|
t.integer "author_id"
@@ -22,22 +22,22 @@ ActiveRecord::Schema.define(version: 20140306202232) 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: 20140306202232) 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,33 @@ ActiveRecord::Schema.define(version: 20140306202232) 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 "tournaments", force: true do |t|
t.integer "game_id"
+ t.integer "status"
+ 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.datetime "created_at"
t.datetime "updated_at"
end