From 88204381fbdef9d9f80d796b695b1e7e0b8f6814 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Thu, 6 Mar 2014 21:39:34 -0500 Subject: fix the tournament_{player,host}s join tables --- .gitignore | 1 + db/migrate/20140307022637_create_servers.rb | 8 ---- db/migrate/20140307022643_create_matches.rb | 10 ----- db/migrate/20140307022648_create_teams.rb | 9 ---- db/migrate/20140307022653_create_alerts.rb | 10 ----- db/migrate/20140307022658_create_pms.rb | 11 ----- db/migrate/20140307022704_create_tournaments.rb | 16 ------- db/migrate/20140307022709_create_games.rb | 15 ------- db/migrate/20140307022714_create_users.rb | 13 ------ db/migrate/20140307022719_create_sessions.rb | 9 ---- .../20140307022725_create_server_settings.rb | 8 ---- .../20140307022729_create_tournament_options.rb | 12 ----- db/migrate/20140307022734_create_game_options.rb | 11 ----- db/migrate/20140307022740_create_scores.rb | 11 ----- ...7022745_create_tournament_players_join_table.rb | 8 ---- ...307022749_create_tournament_hosts_join_table.rb | 8 ---- .../20140307022754_create_user_team_join_table.rb | 8 ---- .../20140307022759_create_match_team_join_table.rb | 8 ---- .../20140307022818_add_hidden_attrs_to_user.rb | 8 ---- db/migrate/20140307023418_create_servers.rb | 8 ++++ db/migrate/20140307023423_create_matches.rb | 10 +++++ db/migrate/20140307023428_create_teams.rb | 9 ++++ db/migrate/20140307023433_create_alerts.rb | 10 +++++ db/migrate/20140307023438_create_pms.rb | 11 +++++ db/migrate/20140307023443_create_tournaments.rb | 16 +++++++ db/migrate/20140307023448_create_games.rb | 15 +++++++ db/migrate/20140307023453_create_users.rb | 13 ++++++ db/migrate/20140307023459_create_sessions.rb | 9 ++++ .../20140307023504_create_server_settings.rb | 8 ++++ .../20140307023509_create_tournament_options.rb | 12 +++++ db/migrate/20140307023514_create_game_options.rb | 11 +++++ db/migrate/20140307023519_create_scores.rb | 11 +++++ ...7023524_create_tournament_players_join_table.rb | 8 ++++ ...307023529_create_tournament_hosts_join_table.rb | 8 ++++ .../20140307023534_create_user_team_join_table.rb | 8 ++++ .../20140307023538_create_match_team_join_table.rb | 8 ++++ .../20140307023557_add_hidden_attrs_to_user.rb | 8 ++++ db/schema.rb | 52 +++++++++------------- generate.sh | 4 +- 39 files changed, 207 insertions(+), 216 deletions(-) delete mode 100644 db/migrate/20140307022637_create_servers.rb delete mode 100644 db/migrate/20140307022643_create_matches.rb delete mode 100644 db/migrate/20140307022648_create_teams.rb delete mode 100644 db/migrate/20140307022653_create_alerts.rb delete mode 100644 db/migrate/20140307022658_create_pms.rb delete mode 100644 db/migrate/20140307022704_create_tournaments.rb delete mode 100644 db/migrate/20140307022709_create_games.rb delete mode 100644 db/migrate/20140307022714_create_users.rb delete mode 100644 db/migrate/20140307022719_create_sessions.rb delete mode 100644 db/migrate/20140307022725_create_server_settings.rb delete mode 100644 db/migrate/20140307022729_create_tournament_options.rb delete mode 100644 db/migrate/20140307022734_create_game_options.rb delete mode 100644 db/migrate/20140307022740_create_scores.rb delete mode 100644 db/migrate/20140307022745_create_tournament_players_join_table.rb delete mode 100644 db/migrate/20140307022749_create_tournament_hosts_join_table.rb delete mode 100644 db/migrate/20140307022754_create_user_team_join_table.rb delete mode 100644 db/migrate/20140307022759_create_match_team_join_table.rb delete mode 100644 db/migrate/20140307022818_add_hidden_attrs_to_user.rb create mode 100644 db/migrate/20140307023418_create_servers.rb create mode 100644 db/migrate/20140307023423_create_matches.rb create mode 100644 db/migrate/20140307023428_create_teams.rb create mode 100644 db/migrate/20140307023433_create_alerts.rb create mode 100644 db/migrate/20140307023438_create_pms.rb create mode 100644 db/migrate/20140307023443_create_tournaments.rb create mode 100644 db/migrate/20140307023448_create_games.rb create mode 100644 db/migrate/20140307023453_create_users.rb create mode 100644 db/migrate/20140307023459_create_sessions.rb create mode 100644 db/migrate/20140307023504_create_server_settings.rb create mode 100644 db/migrate/20140307023509_create_tournament_options.rb create mode 100644 db/migrate/20140307023514_create_game_options.rb create mode 100644 db/migrate/20140307023519_create_scores.rb create mode 100644 db/migrate/20140307023524_create_tournament_players_join_table.rb create mode 100644 db/migrate/20140307023529_create_tournament_hosts_join_table.rb create mode 100644 db/migrate/20140307023534_create_user_team_join_table.rb create mode 100644 db/migrate/20140307023538_create_match_team_join_table.rb create mode 100644 db/migrate/20140307023557_add_hidden_attrs_to_user.rb diff --git a/.gitignore b/.gitignore index 0e07518..830e151 100644 --- a/.gitignore +++ b/.gitignore @@ -23,3 +23,4 @@ nohup.out *~ *# .#* +.nfs* diff --git a/db/migrate/20140307022637_create_servers.rb b/db/migrate/20140307022637_create_servers.rb deleted file mode 100644 index f33241a..0000000 --- a/db/migrate/20140307022637_create_servers.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateServers < ActiveRecord::Migration - def change - create_table :servers do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140307022643_create_matches.rb b/db/migrate/20140307022643_create_matches.rb deleted file mode 100644 index 325863d..0000000 --- a/db/migrate/20140307022643_create_matches.rb +++ /dev/null @@ -1,10 +0,0 @@ -class CreateMatches < ActiveRecord::Migration - def change - create_table :matches do |t| - t.references :tournament, index: true - t.string :name - - t.timestamps - end - end -end diff --git a/db/migrate/20140307022648_create_teams.rb b/db/migrate/20140307022648_create_teams.rb deleted file mode 100644 index fdf9a68..0000000 --- a/db/migrate/20140307022648_create_teams.rb +++ /dev/null @@ -1,9 +0,0 @@ -class CreateTeams < ActiveRecord::Migration - def change - create_table :teams do |t| - t.references :match, index: true - - t.timestamps - end - end -end diff --git a/db/migrate/20140307022653_create_alerts.rb b/db/migrate/20140307022653_create_alerts.rb deleted file mode 100644 index 68a8e10..0000000 --- a/db/migrate/20140307022653_create_alerts.rb +++ /dev/null @@ -1,10 +0,0 @@ -class CreateAlerts < ActiveRecord::Migration - def change - create_table :alerts do |t| - t.references :author, index: true - t.text :message - - t.timestamps - end - end -end diff --git a/db/migrate/20140307022658_create_pms.rb b/db/migrate/20140307022658_create_pms.rb deleted file mode 100644 index 93bb5c6..0000000 --- a/db/migrate/20140307022658_create_pms.rb +++ /dev/null @@ -1,11 +0,0 @@ -class CreatePms < ActiveRecord::Migration - def change - create_table :pms do |t| - t.references :author, index: true - t.references :recipient, index: true - t.text :message - - t.timestamps - end - end -end diff --git a/db/migrate/20140307022704_create_tournaments.rb b/db/migrate/20140307022704_create_tournaments.rb deleted file mode 100644 index 545e603..0000000 --- a/db/migrate/20140307022704_create_tournaments.rb +++ /dev/null @@ -1,16 +0,0 @@ -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/20140307022709_create_games.rb b/db/migrate/20140307022709_create_games.rb deleted file mode 100644 index 5e4f56f..0000000 --- a/db/migrate/20140307022709_create_games.rb +++ /dev/null @@ -1,15 +0,0 @@ -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/20140307022714_create_users.rb b/db/migrate/20140307022714_create_users.rb deleted file mode 100644 index 8032870..0000000 --- a/db/migrate/20140307022714_create_users.rb +++ /dev/null @@ -1,13 +0,0 @@ -class CreateUsers < ActiveRecord::Migration - def change - create_table :users do |t| - t.string :name - t.string :email - t.string :user_name - - t.timestamps - end - add_index :users, :email, unique: true - add_index :users, :user_name, unique: true - end -end diff --git a/db/migrate/20140307022719_create_sessions.rb b/db/migrate/20140307022719_create_sessions.rb deleted file mode 100644 index fe25bf2..0000000 --- a/db/migrate/20140307022719_create_sessions.rb +++ /dev/null @@ -1,9 +0,0 @@ -class CreateSessions < ActiveRecord::Migration - def change - create_table :sessions do |t| - t.references :user, index: true - - t.timestamps - end - end -end diff --git a/db/migrate/20140307022725_create_server_settings.rb b/db/migrate/20140307022725_create_server_settings.rb deleted file mode 100644 index dfdd91b..0000000 --- a/db/migrate/20140307022725_create_server_settings.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateServerSettings < ActiveRecord::Migration - def change - create_table :server_settings do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140307022729_create_tournament_options.rb b/db/migrate/20140307022729_create_tournament_options.rb deleted file mode 100644 index 53b601c..0000000 --- a/db/migrate/20140307022729_create_tournament_options.rb +++ /dev/null @@ -1,12 +0,0 @@ -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 - end -end diff --git a/db/migrate/20140307022734_create_game_options.rb b/db/migrate/20140307022734_create_game_options.rb deleted file mode 100644 index 2f62ef7..0000000 --- a/db/migrate/20140307022734_create_game_options.rb +++ /dev/null @@ -1,11 +0,0 @@ -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/20140307022740_create_scores.rb b/db/migrate/20140307022740_create_scores.rb deleted file mode 100644 index 4ca0b0b..0000000 --- a/db/migrate/20140307022740_create_scores.rb +++ /dev/null @@ -1,11 +0,0 @@ -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/20140307022745_create_tournament_players_join_table.rb b/db/migrate/20140307022745_create_tournament_players_join_table.rb deleted file mode 100644 index 9ff8a7a..0000000 --- a/db/migrate/20140307022745_create_tournament_players_join_table.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateTournamentPlayersJoinTable < ActiveRecord::Migration - def change - create_join_table :users, :tournaments do |t| - # t.index [:user_id, :tournament_id] - # t.index [:tournament_id, :user_id] - end - end -end diff --git a/db/migrate/20140307022749_create_tournament_hosts_join_table.rb b/db/migrate/20140307022749_create_tournament_hosts_join_table.rb deleted file mode 100644 index 0eff550..0000000 --- a/db/migrate/20140307022749_create_tournament_hosts_join_table.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateTournamentHostsJoinTable < ActiveRecord::Migration - def change - create_join_table :users, :tournaments do |t| - # t.index [:user_id, :tournament_id] - # t.index [:tournament_id, :user_id] - end - end -end diff --git a/db/migrate/20140307022754_create_user_team_join_table.rb b/db/migrate/20140307022754_create_user_team_join_table.rb deleted file mode 100644 index 7b4d17f..0000000 --- a/db/migrate/20140307022754_create_user_team_join_table.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateUserTeamJoinTable < ActiveRecord::Migration - def change - create_join_table :users, :matches do |t| - # t.index [:user_id, :match_id] - # t.index [:match_id, :user_id] - end - end -end diff --git a/db/migrate/20140307022759_create_match_team_join_table.rb b/db/migrate/20140307022759_create_match_team_join_table.rb deleted file mode 100644 index c2ed1b7..0000000 --- a/db/migrate/20140307022759_create_match_team_join_table.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateMatchTeamJoinTable < ActiveRecord::Migration - def change - create_join_table :matches, :teams do |t| - # t.index [:match_id, :team_id] - # t.index [:team_id, :match_id] - end - end -end diff --git a/db/migrate/20140307022818_add_hidden_attrs_to_user.rb b/db/migrate/20140307022818_add_hidden_attrs_to_user.rb deleted file mode 100644 index 2f1b0b2..0000000 --- a/db/migrate/20140307022818_add_hidden_attrs_to_user.rb +++ /dev/null @@ -1,8 +0,0 @@ -class AddHiddenAttrsToUser < ActiveRecord::Migration - def change - add_column :users, :password_digest, :string - add_column :users, :remember_token, :string - add_index :users, :remember_token, unique: true - add_column :users, :groups, :integer - end -end diff --git a/db/migrate/20140307023418_create_servers.rb b/db/migrate/20140307023418_create_servers.rb new file mode 100644 index 0000000..f33241a --- /dev/null +++ b/db/migrate/20140307023418_create_servers.rb @@ -0,0 +1,8 @@ +class CreateServers < ActiveRecord::Migration + def change + create_table :servers do |t| + + t.timestamps + end + end +end diff --git a/db/migrate/20140307023423_create_matches.rb b/db/migrate/20140307023423_create_matches.rb new file mode 100644 index 0000000..325863d --- /dev/null +++ b/db/migrate/20140307023423_create_matches.rb @@ -0,0 +1,10 @@ +class CreateMatches < ActiveRecord::Migration + def change + create_table :matches do |t| + t.references :tournament, index: true + t.string :name + + t.timestamps + end + end +end diff --git a/db/migrate/20140307023428_create_teams.rb b/db/migrate/20140307023428_create_teams.rb new file mode 100644 index 0000000..fdf9a68 --- /dev/null +++ b/db/migrate/20140307023428_create_teams.rb @@ -0,0 +1,9 @@ +class CreateTeams < ActiveRecord::Migration + def change + create_table :teams do |t| + t.references :match, index: true + + t.timestamps + end + end +end diff --git a/db/migrate/20140307023433_create_alerts.rb b/db/migrate/20140307023433_create_alerts.rb new file mode 100644 index 0000000..68a8e10 --- /dev/null +++ b/db/migrate/20140307023433_create_alerts.rb @@ -0,0 +1,10 @@ +class CreateAlerts < ActiveRecord::Migration + def change + create_table :alerts do |t| + t.references :author, index: true + t.text :message + + t.timestamps + end + end +end diff --git a/db/migrate/20140307023438_create_pms.rb b/db/migrate/20140307023438_create_pms.rb new file mode 100644 index 0000000..93bb5c6 --- /dev/null +++ b/db/migrate/20140307023438_create_pms.rb @@ -0,0 +1,11 @@ +class CreatePms < ActiveRecord::Migration + def change + create_table :pms do |t| + t.references :author, index: true + t.references :recipient, index: true + t.text :message + + t.timestamps + end + end +end diff --git a/db/migrate/20140307023443_create_tournaments.rb b/db/migrate/20140307023443_create_tournaments.rb new file mode 100644 index 0000000..545e603 --- /dev/null +++ b/db/migrate/20140307023443_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/20140307023448_create_games.rb b/db/migrate/20140307023448_create_games.rb new file mode 100644 index 0000000..5e4f56f --- /dev/null +++ b/db/migrate/20140307023448_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/20140307023453_create_users.rb b/db/migrate/20140307023453_create_users.rb new file mode 100644 index 0000000..8032870 --- /dev/null +++ b/db/migrate/20140307023453_create_users.rb @@ -0,0 +1,13 @@ +class CreateUsers < ActiveRecord::Migration + def change + create_table :users do |t| + t.string :name + t.string :email + t.string :user_name + + t.timestamps + end + add_index :users, :email, unique: true + add_index :users, :user_name, unique: true + end +end diff --git a/db/migrate/20140307023459_create_sessions.rb b/db/migrate/20140307023459_create_sessions.rb new file mode 100644 index 0000000..fe25bf2 --- /dev/null +++ b/db/migrate/20140307023459_create_sessions.rb @@ -0,0 +1,9 @@ +class CreateSessions < ActiveRecord::Migration + def change + create_table :sessions do |t| + t.references :user, index: true + + t.timestamps + end + end +end diff --git a/db/migrate/20140307023504_create_server_settings.rb b/db/migrate/20140307023504_create_server_settings.rb new file mode 100644 index 0000000..dfdd91b --- /dev/null +++ b/db/migrate/20140307023504_create_server_settings.rb @@ -0,0 +1,8 @@ +class CreateServerSettings < ActiveRecord::Migration + def change + create_table :server_settings do |t| + + t.timestamps + end + end +end diff --git a/db/migrate/20140307023509_create_tournament_options.rb b/db/migrate/20140307023509_create_tournament_options.rb new file mode 100644 index 0000000..53b601c --- /dev/null +++ b/db/migrate/20140307023509_create_tournament_options.rb @@ -0,0 +1,12 @@ +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 + end +end diff --git a/db/migrate/20140307023514_create_game_options.rb b/db/migrate/20140307023514_create_game_options.rb new file mode 100644 index 0000000..2f62ef7 --- /dev/null +++ b/db/migrate/20140307023514_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/20140307023519_create_scores.rb b/db/migrate/20140307023519_create_scores.rb new file mode 100644 index 0000000..4ca0b0b --- /dev/null +++ b/db/migrate/20140307023519_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/20140307023524_create_tournament_players_join_table.rb b/db/migrate/20140307023524_create_tournament_players_join_table.rb new file mode 100644 index 0000000..be240e8 --- /dev/null +++ b/db/migrate/20140307023524_create_tournament_players_join_table.rb @@ -0,0 +1,8 @@ +class CreateTournamentPlayersJoinTable < ActiveRecord::Migration + def change + create_join_table :players, :tournaments do |t| + # t.index [:player_id, :tournament_id] + # t.index [:tournament_id, :player_id] + end + end +end diff --git a/db/migrate/20140307023529_create_tournament_hosts_join_table.rb b/db/migrate/20140307023529_create_tournament_hosts_join_table.rb new file mode 100644 index 0000000..7521d89 --- /dev/null +++ b/db/migrate/20140307023529_create_tournament_hosts_join_table.rb @@ -0,0 +1,8 @@ +class CreateTournamentHostsJoinTable < ActiveRecord::Migration + def change + create_join_table :hosts, :tournaments do |t| + # t.index [:host_id, :tournament_id] + # t.index [:tournament_id, :host_id] + end + end +end diff --git a/db/migrate/20140307023534_create_user_team_join_table.rb b/db/migrate/20140307023534_create_user_team_join_table.rb new file mode 100644 index 0000000..7b4d17f --- /dev/null +++ b/db/migrate/20140307023534_create_user_team_join_table.rb @@ -0,0 +1,8 @@ +class CreateUserTeamJoinTable < ActiveRecord::Migration + def change + create_join_table :users, :matches do |t| + # t.index [:user_id, :match_id] + # t.index [:match_id, :user_id] + end + end +end diff --git a/db/migrate/20140307023538_create_match_team_join_table.rb b/db/migrate/20140307023538_create_match_team_join_table.rb new file mode 100644 index 0000000..c2ed1b7 --- /dev/null +++ b/db/migrate/20140307023538_create_match_team_join_table.rb @@ -0,0 +1,8 @@ +class CreateMatchTeamJoinTable < ActiveRecord::Migration + def change + create_join_table :matches, :teams do |t| + # t.index [:match_id, :team_id] + # t.index [:team_id, :match_id] + end + end +end diff --git a/db/migrate/20140307023557_add_hidden_attrs_to_user.rb b/db/migrate/20140307023557_add_hidden_attrs_to_user.rb new file mode 100644 index 0000000..2f1b0b2 --- /dev/null +++ b/db/migrate/20140307023557_add_hidden_attrs_to_user.rb @@ -0,0 +1,8 @@ +class AddHiddenAttrsToUser < ActiveRecord::Migration + def change + add_column :users, :password_digest, :string + add_column :users, :remember_token, :string + add_index :users, :remember_token, unique: true + add_column :users, :groups, :integer + end +end diff --git a/db/schema.rb b/db/schema.rb index cae1815..16789fb 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: 20140307004100) do +ActiveRecord::Schema.define(version: 20140307023557) do create_table "alerts", force: true do |t| t.integer "author_id" @@ -42,6 +42,11 @@ ActiveRecord::Schema.define(version: 20140307004100) do t.datetime "updated_at" end + create_table "hosts_tournaments", id: false, force: true do |t| + t.integer "host_id", null: false + t.integer "tournament_id", null: false + end + create_table "matches", force: true do |t| t.integer "tournament_id" t.string "name" @@ -51,6 +56,21 @@ ActiveRecord::Schema.define(version: 20140307004100) do add_index "matches", ["tournament_id"], name: "index_matches_on_tournament_id" + create_table "matches_teams", id: false, force: true do |t| + t.integer "match_id", null: false + t.integer "team_id", null: false + end + + create_table "matches_users", id: false, force: true do |t| + t.integer "user_id", null: false + t.integer "match_id", null: false + end + + create_table "players_tournaments", id: false, force: true do |t| + t.integer "player_id", null: false + t.integer "tournament_id", null: false + end + create_table "pms", force: true do |t| t.integer "author_id" t.integer "recipient_id" @@ -91,16 +111,6 @@ ActiveRecord::Schema.define(version: 20140307004100) do add_index "sessions", ["user_id"], name: "index_sessions_on_user_id" - create_table "team_match_pairs", force: true do |t| - t.integer "team_id" - t.integer "match_id" - t.datetime "created_at" - t.datetime "updated_at" - end - - add_index "team_match_pairs", ["match_id"], name: "index_team_match_pairs_on_match_id" - 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" @@ -135,26 +145,6 @@ ActiveRecord::Schema.define(version: 20140307004100) do add_index "tournaments", ["game_id"], name: "index_tournaments_on_game_id" - create_table "user_team_pairs", force: true do |t| - t.integer "user_id" - t.integer "team_id" - t.datetime "created_at" - t.datetime "updated_at" - end - - add_index "user_team_pairs", ["team_id"], name: "index_user_team_pairs_on_team_id" - add_index "user_team_pairs", ["user_id"], name: "index_user_team_pairs_on_user_id" - - create_table "user_tournament_pairs", force: true do |t| - t.integer "user_id" - t.integer "tournament_id" - t.datetime "created_at" - t.datetime "updated_at" - end - - add_index "user_tournament_pairs", ["tournament_id"], name: "index_user_tournament_pairs_on_tournament_id" - add_index "user_tournament_pairs", ["user_id"], name: "index_user_tournament_pairs_on_user_id" - create_table "users", force: true do |t| t.string "name" t.string "email" diff --git a/generate.sh b/generate.sh index 22c6f4a..03225e7 100755 --- a/generate.sh +++ b/generate.sh @@ -41,8 +41,8 @@ bundle exec rails generate model game_option vartype:integer name:string default bundle exec rails generate model score user:references match:references value:integer $NOTEST # Join tables -bundle exec rails generate migration CreateTournamentPlayersJoinTable users tournaments -bundle exec rails generate migration CreateTournamentHostsJoinTable users tournaments +bundle exec rails generate migration CreateTournamentPlayersJoinTable players tournaments +bundle exec rails generate migration CreateTournamentHostsJoinTable hosts tournaments bundle exec rails generate migration CreateUserTeamJoinTable users matches bundle exec rails generate migration CreateMatchTeamJoinTable matches teams -- cgit v1.2.3-2-g168b