From 933199499f9adfa0347783c538a10b88ffb1b98b Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Wed, 23 Apr 2014 20:56:43 -0400 Subject: run ./generate.sh --- .../20140422172559_create_simple_captcha_data.rb | 15 ------ ...0422212555_create_mailboxer.mailboxer_engine.rb | 62 ---------------------- ...2212556_add_notified_object.mailboxer_engine.rb | 18 ------- ...12557_add_notification_code.mailboxer_engine.rb | 14 ----- ...40422212558_add_attachments.mailboxer_engine.rb | 10 ---- ...212559_rename_receipts_read.mailboxer_engine.rb | 10 ---- ...global_notification_support.mailboxer_engine.rb | 10 ---- db/migrate/20140422212602_create_delayed_jobs.rb | 22 -------- db/migrate/20140422212605_create_servers.rb | 9 ---- db/migrate/20140422212609_create_matches.rb | 13 ----- db/migrate/20140422212613_create_teams.rb | 8 --- db/migrate/20140422212616_create_alerts.rb | 10 ---- db/migrate/20140422212619_create_pms.rb | 11 ---- db/migrate/20140422212623_create_tournaments.rb | 19 ------- db/migrate/20140422212627_create_games.rb | 17 ------ db/migrate/20140422212630_create_users.rb | 13 ----- db/migrate/20140422212634_create_sessions.rb | 11 ---- db/migrate/20140422212637_create_brackets.rb | 11 ---- db/migrate/20140422212641_create_game_settings.rb | 15 ------ .../20140422212644_create_tournament_settings.rb | 15 ------ .../20140422212648_create_tournament_stages.rb | 11 ---- db/migrate/20140422212651_create_statistics.rb | 12 ----- .../20140422212654_create_remote_usernames.rb | 11 ---- .../20140422212657_create_bracket_matches.rb | 11 ---- db/migrate/20140422212701_create_api_requests.rb | 9 ---- ...2212704_create_tournament_players_join_table.rb | 8 --- ...422212707_create_tournament_hosts_join_table.rb | 8 --- .../20140422212711_create_team_user_join_table.rb | 8 --- .../20140422212714_create_match_team_join_table.rb | 8 --- .../20140422212727_add_hidden_attrs_to_user.rb | 6 --- .../20140423205436_create_simple_captcha_data.rb | 15 ++++++ ...0424005433_create_mailboxer.mailboxer_engine.rb | 62 ++++++++++++++++++++++ ...4005434_add_notified_object.mailboxer_engine.rb | 18 +++++++ ...05435_add_notification_code.mailboxer_engine.rb | 14 +++++ ...40424005436_add_attachments.mailboxer_engine.rb | 10 ++++ ...005437_rename_receipts_read.mailboxer_engine.rb | 10 ++++ ...global_notification_support.mailboxer_engine.rb | 10 ++++ db/migrate/20140424005439_create_delayed_jobs.rb | 22 ++++++++ db/migrate/20140424005442_create_servers.rb | 9 ++++ db/migrate/20140424005445_create_matches.rb | 13 +++++ db/migrate/20140424005448_create_teams.rb | 8 +++ db/migrate/20140424005451_create_alerts.rb | 10 ++++ db/migrate/20140424005454_create_pms.rb | 11 ++++ db/migrate/20140424005457_create_tournaments.rb | 19 +++++++ db/migrate/20140424005500_create_games.rb | 17 ++++++ db/migrate/20140424005503_create_users.rb | 13 +++++ db/migrate/20140424005506_create_sessions.rb | 11 ++++ db/migrate/20140424005509_create_brackets.rb | 11 ++++ db/migrate/20140424005512_create_game_settings.rb | 15 ++++++ .../20140424005515_create_tournament_settings.rb | 15 ++++++ .../20140424005519_create_tournament_stages.rb | 11 ++++ db/migrate/20140424005523_create_statistics.rb | 12 +++++ .../20140424005527_create_remote_usernames.rb | 11 ++++ .../20140424005530_create_bracket_matches.rb | 11 ++++ db/migrate/20140424005533_create_api_requests.rb | 9 ++++ ...4005536_create_tournament_players_join_table.rb | 8 +++ ...424005539_create_tournament_hosts_join_table.rb | 8 +++ .../20140424005542_create_team_user_join_table.rb | 8 +++ .../20140424005544_create_match_team_join_table.rb | 8 +++ .../20140424005552_add_hidden_attrs_to_user.rb | 6 +++ db/schema.rb | 2 +- 61 files changed, 406 insertions(+), 406 deletions(-) delete mode 100644 db/migrate/20140422172559_create_simple_captcha_data.rb delete mode 100644 db/migrate/20140422212555_create_mailboxer.mailboxer_engine.rb delete mode 100644 db/migrate/20140422212556_add_notified_object.mailboxer_engine.rb delete mode 100644 db/migrate/20140422212557_add_notification_code.mailboxer_engine.rb delete mode 100644 db/migrate/20140422212558_add_attachments.mailboxer_engine.rb delete mode 100644 db/migrate/20140422212559_rename_receipts_read.mailboxer_engine.rb delete mode 100644 db/migrate/20140422212560_add_global_notification_support.mailboxer_engine.rb delete mode 100644 db/migrate/20140422212602_create_delayed_jobs.rb delete mode 100644 db/migrate/20140422212605_create_servers.rb delete mode 100644 db/migrate/20140422212609_create_matches.rb delete mode 100644 db/migrate/20140422212613_create_teams.rb delete mode 100644 db/migrate/20140422212616_create_alerts.rb delete mode 100644 db/migrate/20140422212619_create_pms.rb delete mode 100644 db/migrate/20140422212623_create_tournaments.rb delete mode 100644 db/migrate/20140422212627_create_games.rb delete mode 100644 db/migrate/20140422212630_create_users.rb delete mode 100644 db/migrate/20140422212634_create_sessions.rb delete mode 100644 db/migrate/20140422212637_create_brackets.rb delete mode 100644 db/migrate/20140422212641_create_game_settings.rb delete mode 100644 db/migrate/20140422212644_create_tournament_settings.rb delete mode 100644 db/migrate/20140422212648_create_tournament_stages.rb delete mode 100644 db/migrate/20140422212651_create_statistics.rb delete mode 100644 db/migrate/20140422212654_create_remote_usernames.rb delete mode 100644 db/migrate/20140422212657_create_bracket_matches.rb delete mode 100644 db/migrate/20140422212701_create_api_requests.rb delete mode 100644 db/migrate/20140422212704_create_tournament_players_join_table.rb delete mode 100644 db/migrate/20140422212707_create_tournament_hosts_join_table.rb delete mode 100644 db/migrate/20140422212711_create_team_user_join_table.rb delete mode 100644 db/migrate/20140422212714_create_match_team_join_table.rb delete mode 100644 db/migrate/20140422212727_add_hidden_attrs_to_user.rb create mode 100644 db/migrate/20140423205436_create_simple_captcha_data.rb create mode 100644 db/migrate/20140424005433_create_mailboxer.mailboxer_engine.rb create mode 100644 db/migrate/20140424005434_add_notified_object.mailboxer_engine.rb create mode 100644 db/migrate/20140424005435_add_notification_code.mailboxer_engine.rb create mode 100644 db/migrate/20140424005436_add_attachments.mailboxer_engine.rb create mode 100644 db/migrate/20140424005437_rename_receipts_read.mailboxer_engine.rb create mode 100644 db/migrate/20140424005438_add_global_notification_support.mailboxer_engine.rb create mode 100644 db/migrate/20140424005439_create_delayed_jobs.rb create mode 100644 db/migrate/20140424005442_create_servers.rb create mode 100644 db/migrate/20140424005445_create_matches.rb create mode 100644 db/migrate/20140424005448_create_teams.rb create mode 100644 db/migrate/20140424005451_create_alerts.rb create mode 100644 db/migrate/20140424005454_create_pms.rb create mode 100644 db/migrate/20140424005457_create_tournaments.rb create mode 100644 db/migrate/20140424005500_create_games.rb create mode 100644 db/migrate/20140424005503_create_users.rb create mode 100644 db/migrate/20140424005506_create_sessions.rb create mode 100644 db/migrate/20140424005509_create_brackets.rb create mode 100644 db/migrate/20140424005512_create_game_settings.rb create mode 100644 db/migrate/20140424005515_create_tournament_settings.rb create mode 100644 db/migrate/20140424005519_create_tournament_stages.rb create mode 100644 db/migrate/20140424005523_create_statistics.rb create mode 100644 db/migrate/20140424005527_create_remote_usernames.rb create mode 100644 db/migrate/20140424005530_create_bracket_matches.rb create mode 100644 db/migrate/20140424005533_create_api_requests.rb create mode 100644 db/migrate/20140424005536_create_tournament_players_join_table.rb create mode 100644 db/migrate/20140424005539_create_tournament_hosts_join_table.rb create mode 100644 db/migrate/20140424005542_create_team_user_join_table.rb create mode 100644 db/migrate/20140424005544_create_match_team_join_table.rb create mode 100644 db/migrate/20140424005552_add_hidden_attrs_to_user.rb (limited to 'db') diff --git a/db/migrate/20140422172559_create_simple_captcha_data.rb b/db/migrate/20140422172559_create_simple_captcha_data.rb deleted file mode 100644 index 4573b20..0000000 --- a/db/migrate/20140422172559_create_simple_captcha_data.rb +++ /dev/null @@ -1,15 +0,0 @@ -class CreateSimpleCaptchaData < ActiveRecord::Migration - def self.up - create_table :simple_captcha_data do |t| - t.string :key, :limit => 40 - t.string :value, :limit => 6 - t.timestamps - end - - add_index :simple_captcha_data, :key, :name => "idx_key" - end - - def self.down - drop_table :simple_captcha_data - end -end diff --git a/db/migrate/20140422212555_create_mailboxer.mailboxer_engine.rb b/db/migrate/20140422212555_create_mailboxer.mailboxer_engine.rb deleted file mode 100644 index 690cec2..0000000 --- a/db/migrate/20140422212555_create_mailboxer.mailboxer_engine.rb +++ /dev/null @@ -1,62 +0,0 @@ -# This migration comes from mailboxer_engine (originally 20110511145103) -class CreateMailboxer < ActiveRecord::Migration - def self.up - #Tables - #Conversations - create_table :conversations do |t| - t.column :subject, :string, :default => "" - t.column :created_at, :datetime, :null => false - t.column :updated_at, :datetime, :null => false - end - #Receipts - create_table :receipts do |t| - t.references :receiver, :polymorphic => true - t.column :notification_id, :integer, :null => false - t.column :read, :boolean, :default => false - t.column :trashed, :boolean, :default => false - t.column :deleted, :boolean, :default => false - t.column :mailbox_type, :string, :limit => 25 - t.column :created_at, :datetime, :null => false - t.column :updated_at, :datetime, :null => false - end - #Notifications and Messages - create_table :notifications do |t| - t.column :type, :string - t.column :body, :text - t.column :subject, :string, :default => "" - t.references :sender, :polymorphic => true - t.references :object, :polymorphic => true - t.column :conversation_id, :integer - t.column :draft, :boolean, :default => false - t.column :updated_at, :datetime, :null => false - t.column :created_at, :datetime, :null => false - end - - - #Indexes - #Conversations - #Receipts - add_index "receipts","notification_id" - - #Messages - add_index "notifications","conversation_id" - - #Foreign keys - #Conversations - #Receipts - add_foreign_key "receipts", "notifications", :name => "receipts_on_notification_id" - #Messages - add_foreign_key "notifications", "conversations", :name => "notifications_on_conversation_id" - end - - def self.down - #Tables - remove_foreign_key "receipts", :name => "receipts_on_notification_id" - remove_foreign_key "notifications", :name => "notifications_on_conversation_id" - - #Indexes - drop_table :receipts - drop_table :conversations - drop_table :notifications - end -end diff --git a/db/migrate/20140422212556_add_notified_object.mailboxer_engine.rb b/db/migrate/20140422212556_add_notified_object.mailboxer_engine.rb deleted file mode 100644 index 7f41ac6..0000000 --- a/db/migrate/20140422212556_add_notified_object.mailboxer_engine.rb +++ /dev/null @@ -1,18 +0,0 @@ -# This migration comes from mailboxer_engine (originally 20110719110700) -class AddNotifiedObject < ActiveRecord::Migration - def self.up - change_table :notifications do |t| - t.references :notified_object, :polymorphic => true - t.remove :object_id - t.remove :object_type - end - end - - def self.down - change_table :notifications do |t| - t.remove :notified_object_id - t.remove :notified_object_type - t.references :object, :polymorphic => true - end - end -end diff --git a/db/migrate/20140422212557_add_notification_code.mailboxer_engine.rb b/db/migrate/20140422212557_add_notification_code.mailboxer_engine.rb deleted file mode 100644 index 04c12ef..0000000 --- a/db/migrate/20140422212557_add_notification_code.mailboxer_engine.rb +++ /dev/null @@ -1,14 +0,0 @@ -# This migration comes from mailboxer_engine (originally 20110912163911) -class AddNotificationCode < ActiveRecord::Migration - def self.up - change_table :notifications do |t| - t.string :notification_code, :default => nil - end - end - - def self.down - change_table :notifications do |t| - t.remove :notification_code - end - end -end \ No newline at end of file diff --git a/db/migrate/20140422212558_add_attachments.mailboxer_engine.rb b/db/migrate/20140422212558_add_attachments.mailboxer_engine.rb deleted file mode 100644 index b8d6588..0000000 --- a/db/migrate/20140422212558_add_attachments.mailboxer_engine.rb +++ /dev/null @@ -1,10 +0,0 @@ -# This migration comes from mailboxer_engine (originally 20111204163911) -class AddAttachments < ActiveRecord::Migration - def self.up - add_column :notifications, :attachment, :string - end - - def self.down - remove_column :notifications, :attachment - end -end diff --git a/db/migrate/20140422212559_rename_receipts_read.mailboxer_engine.rb b/db/migrate/20140422212559_rename_receipts_read.mailboxer_engine.rb deleted file mode 100644 index 9ce904f..0000000 --- a/db/migrate/20140422212559_rename_receipts_read.mailboxer_engine.rb +++ /dev/null @@ -1,10 +0,0 @@ -# This migration comes from mailboxer_engine (originally 20120813110712) -class RenameReceiptsRead < ActiveRecord::Migration - def up - rename_column :receipts, :read, :is_read - end - - def down - rename_column :receipts, :is_read, :read - end -end diff --git a/db/migrate/20140422212560_add_global_notification_support.mailboxer_engine.rb b/db/migrate/20140422212560_add_global_notification_support.mailboxer_engine.rb deleted file mode 100644 index 60f67ab..0000000 --- a/db/migrate/20140422212560_add_global_notification_support.mailboxer_engine.rb +++ /dev/null @@ -1,10 +0,0 @@ -# This migration comes from mailboxer_engine (originally 20130305144212) -class AddGlobalNotificationSupport < ActiveRecord::Migration - - def change - change_table :notifications do |t| - t.boolean :global, default: false - t.datetime :expires - end - end -end diff --git a/db/migrate/20140422212602_create_delayed_jobs.rb b/db/migrate/20140422212602_create_delayed_jobs.rb deleted file mode 100644 index ec0dd93..0000000 --- a/db/migrate/20140422212602_create_delayed_jobs.rb +++ /dev/null @@ -1,22 +0,0 @@ -class CreateDelayedJobs < ActiveRecord::Migration - def self.up - create_table :delayed_jobs, :force => true do |table| - table.integer :priority, :default => 0, :null => false # Allows some jobs to jump to the front of the queue - table.integer :attempts, :default => 0, :null => false # Provides for retries, but still fail eventually. - table.text :handler, :null => false # YAML-encoded string of the object that will do work - table.text :last_error # reason for last failure (See Note below) - table.datetime :run_at # When to run. Could be Time.zone.now for immediately, or sometime in the future. - table.datetime :locked_at # Set when a client is working on this object - table.datetime :failed_at # Set when all retries have failed (actually, by default, the record is deleted instead) - table.string :locked_by # Who is working on this object (if locked) - table.string :queue # The name of the queue this job is in - table.timestamps - end - - add_index :delayed_jobs, [:priority, :run_at], :name => 'delayed_jobs_priority' - end - - def self.down - drop_table :delayed_jobs - end -end diff --git a/db/migrate/20140422212605_create_servers.rb b/db/migrate/20140422212605_create_servers.rb deleted file mode 100644 index fbe1b02..0000000 --- a/db/migrate/20140422212605_create_servers.rb +++ /dev/null @@ -1,9 +0,0 @@ -class CreateServers < ActiveRecord::Migration - def change - create_table :servers do |t| - t.integer :default_user_permissions - - t.timestamps - end - end -end diff --git a/db/migrate/20140422212609_create_matches.rb b/db/migrate/20140422212609_create_matches.rb deleted file mode 100644 index bac92d1..0000000 --- a/db/migrate/20140422212609_create_matches.rb +++ /dev/null @@ -1,13 +0,0 @@ -class CreateMatches < ActiveRecord::Migration - def change - create_table :matches do |t| - t.integer :status - t.references :tournament_stage, index: true - t.references :winner, index: true - t.text :remote_id - t.integer :submitted_peer_evaluations - - t.timestamps - end - end -end diff --git a/db/migrate/20140422212613_create_teams.rb b/db/migrate/20140422212613_create_teams.rb deleted file mode 100644 index dd8397d..0000000 --- a/db/migrate/20140422212613_create_teams.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateTeams < ActiveRecord::Migration - def change - create_table :teams do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140422212616_create_alerts.rb b/db/migrate/20140422212616_create_alerts.rb deleted file mode 100644 index 68a8e10..0000000 --- a/db/migrate/20140422212616_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/20140422212619_create_pms.rb b/db/migrate/20140422212619_create_pms.rb deleted file mode 100644 index 93bb5c6..0000000 --- a/db/migrate/20140422212619_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/20140422212623_create_tournaments.rb b/db/migrate/20140422212623_create_tournaments.rb deleted file mode 100644 index 716871f..0000000 --- a/db/migrate/20140422212623_create_tournaments.rb +++ /dev/null @@ -1,19 +0,0 @@ -class CreateTournaments < ActiveRecord::Migration - def change - create_table :tournaments do |t| - t.references :game, index: true - t.integer :status - t.string :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.string :sampling_method - - t.timestamps - end - add_index :tournaments, :name, unique: true - end -end diff --git a/db/migrate/20140422212627_create_games.rb b/db/migrate/20140422212627_create_games.rb deleted file mode 100644 index 46ed30d..0000000 --- a/db/migrate/20140422212627_create_games.rb +++ /dev/null @@ -1,17 +0,0 @@ -class CreateGames < ActiveRecord::Migration - def change - create_table :games do |t| - t.string :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.string :sampling_method - - t.timestamps - end - add_index :games, :name, unique: true - end -end diff --git a/db/migrate/20140422212630_create_users.rb b/db/migrate/20140422212630_create_users.rb deleted file mode 100644 index 8032870..0000000 --- a/db/migrate/20140422212630_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/20140422212634_create_sessions.rb b/db/migrate/20140422212634_create_sessions.rb deleted file mode 100644 index f667f1e..0000000 --- a/db/migrate/20140422212634_create_sessions.rb +++ /dev/null @@ -1,11 +0,0 @@ -class CreateSessions < ActiveRecord::Migration - def change - create_table :sessions do |t| - t.references :user, index: true - t.string :token - - t.timestamps - end - add_index :sessions, :token, unique: true - end -end diff --git a/db/migrate/20140422212637_create_brackets.rb b/db/migrate/20140422212637_create_brackets.rb deleted file mode 100644 index 8813bf2..0000000 --- a/db/migrate/20140422212637_create_brackets.rb +++ /dev/null @@ -1,11 +0,0 @@ -class CreateBrackets < ActiveRecord::Migration - def change - create_table :brackets do |t| - t.references :user, index: true - t.references :tournament, index: true - t.string :name - - t.timestamps - end - end -end diff --git a/db/migrate/20140422212641_create_game_settings.rb b/db/migrate/20140422212641_create_game_settings.rb deleted file mode 100644 index 06fb72e..0000000 --- a/db/migrate/20140422212641_create_game_settings.rb +++ /dev/null @@ -1,15 +0,0 @@ -class CreateGameSettings < ActiveRecord::Migration - def change - create_table :game_settings do |t| - t.references :game, index: true - t.string :name - t.integer :vartype - t.text :type_opt - t.text :description - t.integer :display_order - t.text :default - - t.timestamps - end - end -end diff --git a/db/migrate/20140422212644_create_tournament_settings.rb b/db/migrate/20140422212644_create_tournament_settings.rb deleted file mode 100644 index e56697f..0000000 --- a/db/migrate/20140422212644_create_tournament_settings.rb +++ /dev/null @@ -1,15 +0,0 @@ -class CreateTournamentSettings < ActiveRecord::Migration - def change - create_table :tournament_settings do |t| - t.references :tournament, index: true - t.string :name - t.integer :vartype - t.text :type_opt - t.text :description - t.integer :display_order - t.text :value - - t.timestamps - end - end -end diff --git a/db/migrate/20140422212648_create_tournament_stages.rb b/db/migrate/20140422212648_create_tournament_stages.rb deleted file mode 100644 index e3668cb..0000000 --- a/db/migrate/20140422212648_create_tournament_stages.rb +++ /dev/null @@ -1,11 +0,0 @@ -class CreateTournamentStages < ActiveRecord::Migration - def change - create_table :tournament_stages do |t| - t.references :tournament, index: true - t.string :scheduling - t.text :structure - - t.timestamps - end - end -end diff --git a/db/migrate/20140422212651_create_statistics.rb b/db/migrate/20140422212651_create_statistics.rb deleted file mode 100644 index cc2e97d..0000000 --- a/db/migrate/20140422212651_create_statistics.rb +++ /dev/null @@ -1,12 +0,0 @@ -class CreateStatistics < ActiveRecord::Migration - def change - create_table :statistics do |t| - t.references :user, index: true - t.references :match, index: true - t.string :name - t.integer :value - - t.timestamps - end - end -end diff --git a/db/migrate/20140422212654_create_remote_usernames.rb b/db/migrate/20140422212654_create_remote_usernames.rb deleted file mode 100644 index e265985..0000000 --- a/db/migrate/20140422212654_create_remote_usernames.rb +++ /dev/null @@ -1,11 +0,0 @@ -class CreateRemoteUsernames < ActiveRecord::Migration - def change - create_table :remote_usernames do |t| - t.references :game, index: true - t.references :user, index: true - t.text :json_value - - t.timestamps - end - end -end diff --git a/db/migrate/20140422212657_create_bracket_matches.rb b/db/migrate/20140422212657_create_bracket_matches.rb deleted file mode 100644 index 3323e31..0000000 --- a/db/migrate/20140422212657_create_bracket_matches.rb +++ /dev/null @@ -1,11 +0,0 @@ -class CreateBracketMatches < ActiveRecord::Migration - def change - create_table :bracket_matches do |t| - t.references :bracket, index: true - t.references :match, index: true - t.references :predicted_winner, index: true - - t.timestamps - end - end -end diff --git a/db/migrate/20140422212701_create_api_requests.rb b/db/migrate/20140422212701_create_api_requests.rb deleted file mode 100644 index 544c330..0000000 --- a/db/migrate/20140422212701_create_api_requests.rb +++ /dev/null @@ -1,9 +0,0 @@ -class CreateApiRequests < ActiveRecord::Migration - def change - create_table :api_requests do |t| - t.string :api_name - - t.timestamps - end - end -end diff --git a/db/migrate/20140422212704_create_tournament_players_join_table.rb b/db/migrate/20140422212704_create_tournament_players_join_table.rb deleted file mode 100644 index be240e8..0000000 --- a/db/migrate/20140422212704_create_tournament_players_join_table.rb +++ /dev/null @@ -1,8 +0,0 @@ -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/20140422212707_create_tournament_hosts_join_table.rb b/db/migrate/20140422212707_create_tournament_hosts_join_table.rb deleted file mode 100644 index 7521d89..0000000 --- a/db/migrate/20140422212707_create_tournament_hosts_join_table.rb +++ /dev/null @@ -1,8 +0,0 @@ -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/20140422212711_create_team_user_join_table.rb b/db/migrate/20140422212711_create_team_user_join_table.rb deleted file mode 100644 index f3b57fc..0000000 --- a/db/migrate/20140422212711_create_team_user_join_table.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateTeamUserJoinTable < ActiveRecord::Migration - def change - create_join_table :teams, :users do |t| - # t.index [:team_id, :user_id] - # t.index [:user_id, :team_id] - end - end -end diff --git a/db/migrate/20140422212714_create_match_team_join_table.rb b/db/migrate/20140422212714_create_match_team_join_table.rb deleted file mode 100644 index c2ed1b7..0000000 --- a/db/migrate/20140422212714_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/20140422212727_add_hidden_attrs_to_user.rb b/db/migrate/20140422212727_add_hidden_attrs_to_user.rb deleted file mode 100644 index 9b5c505..0000000 --- a/db/migrate/20140422212727_add_hidden_attrs_to_user.rb +++ /dev/null @@ -1,6 +0,0 @@ -class AddHiddenAttrsToUser < ActiveRecord::Migration - def change - add_column :users, :password_digest, :string - add_column :users, :permissions, :integer - end -end diff --git a/db/migrate/20140423205436_create_simple_captcha_data.rb b/db/migrate/20140423205436_create_simple_captcha_data.rb new file mode 100644 index 0000000..4573b20 --- /dev/null +++ b/db/migrate/20140423205436_create_simple_captcha_data.rb @@ -0,0 +1,15 @@ +class CreateSimpleCaptchaData < ActiveRecord::Migration + def self.up + create_table :simple_captcha_data do |t| + t.string :key, :limit => 40 + t.string :value, :limit => 6 + t.timestamps + end + + add_index :simple_captcha_data, :key, :name => "idx_key" + end + + def self.down + drop_table :simple_captcha_data + end +end diff --git a/db/migrate/20140424005433_create_mailboxer.mailboxer_engine.rb b/db/migrate/20140424005433_create_mailboxer.mailboxer_engine.rb new file mode 100644 index 0000000..690cec2 --- /dev/null +++ b/db/migrate/20140424005433_create_mailboxer.mailboxer_engine.rb @@ -0,0 +1,62 @@ +# This migration comes from mailboxer_engine (originally 20110511145103) +class CreateMailboxer < ActiveRecord::Migration + def self.up + #Tables + #Conversations + create_table :conversations do |t| + t.column :subject, :string, :default => "" + t.column :created_at, :datetime, :null => false + t.column :updated_at, :datetime, :null => false + end + #Receipts + create_table :receipts do |t| + t.references :receiver, :polymorphic => true + t.column :notification_id, :integer, :null => false + t.column :read, :boolean, :default => false + t.column :trashed, :boolean, :default => false + t.column :deleted, :boolean, :default => false + t.column :mailbox_type, :string, :limit => 25 + t.column :created_at, :datetime, :null => false + t.column :updated_at, :datetime, :null => false + end + #Notifications and Messages + create_table :notifications do |t| + t.column :type, :string + t.column :body, :text + t.column :subject, :string, :default => "" + t.references :sender, :polymorphic => true + t.references :object, :polymorphic => true + t.column :conversation_id, :integer + t.column :draft, :boolean, :default => false + t.column :updated_at, :datetime, :null => false + t.column :created_at, :datetime, :null => false + end + + + #Indexes + #Conversations + #Receipts + add_index "receipts","notification_id" + + #Messages + add_index "notifications","conversation_id" + + #Foreign keys + #Conversations + #Receipts + add_foreign_key "receipts", "notifications", :name => "receipts_on_notification_id" + #Messages + add_foreign_key "notifications", "conversations", :name => "notifications_on_conversation_id" + end + + def self.down + #Tables + remove_foreign_key "receipts", :name => "receipts_on_notification_id" + remove_foreign_key "notifications", :name => "notifications_on_conversation_id" + + #Indexes + drop_table :receipts + drop_table :conversations + drop_table :notifications + end +end diff --git a/db/migrate/20140424005434_add_notified_object.mailboxer_engine.rb b/db/migrate/20140424005434_add_notified_object.mailboxer_engine.rb new file mode 100644 index 0000000..7f41ac6 --- /dev/null +++ b/db/migrate/20140424005434_add_notified_object.mailboxer_engine.rb @@ -0,0 +1,18 @@ +# This migration comes from mailboxer_engine (originally 20110719110700) +class AddNotifiedObject < ActiveRecord::Migration + def self.up + change_table :notifications do |t| + t.references :notified_object, :polymorphic => true + t.remove :object_id + t.remove :object_type + end + end + + def self.down + change_table :notifications do |t| + t.remove :notified_object_id + t.remove :notified_object_type + t.references :object, :polymorphic => true + end + end +end diff --git a/db/migrate/20140424005435_add_notification_code.mailboxer_engine.rb b/db/migrate/20140424005435_add_notification_code.mailboxer_engine.rb new file mode 100644 index 0000000..04c12ef --- /dev/null +++ b/db/migrate/20140424005435_add_notification_code.mailboxer_engine.rb @@ -0,0 +1,14 @@ +# This migration comes from mailboxer_engine (originally 20110912163911) +class AddNotificationCode < ActiveRecord::Migration + def self.up + change_table :notifications do |t| + t.string :notification_code, :default => nil + end + end + + def self.down + change_table :notifications do |t| + t.remove :notification_code + end + end +end \ No newline at end of file diff --git a/db/migrate/20140424005436_add_attachments.mailboxer_engine.rb b/db/migrate/20140424005436_add_attachments.mailboxer_engine.rb new file mode 100644 index 0000000..b8d6588 --- /dev/null +++ b/db/migrate/20140424005436_add_attachments.mailboxer_engine.rb @@ -0,0 +1,10 @@ +# This migration comes from mailboxer_engine (originally 20111204163911) +class AddAttachments < ActiveRecord::Migration + def self.up + add_column :notifications, :attachment, :string + end + + def self.down + remove_column :notifications, :attachment + end +end diff --git a/db/migrate/20140424005437_rename_receipts_read.mailboxer_engine.rb b/db/migrate/20140424005437_rename_receipts_read.mailboxer_engine.rb new file mode 100644 index 0000000..9ce904f --- /dev/null +++ b/db/migrate/20140424005437_rename_receipts_read.mailboxer_engine.rb @@ -0,0 +1,10 @@ +# This migration comes from mailboxer_engine (originally 20120813110712) +class RenameReceiptsRead < ActiveRecord::Migration + def up + rename_column :receipts, :read, :is_read + end + + def down + rename_column :receipts, :is_read, :read + end +end diff --git a/db/migrate/20140424005438_add_global_notification_support.mailboxer_engine.rb b/db/migrate/20140424005438_add_global_notification_support.mailboxer_engine.rb new file mode 100644 index 0000000..60f67ab --- /dev/null +++ b/db/migrate/20140424005438_add_global_notification_support.mailboxer_engine.rb @@ -0,0 +1,10 @@ +# This migration comes from mailboxer_engine (originally 20130305144212) +class AddGlobalNotificationSupport < ActiveRecord::Migration + + def change + change_table :notifications do |t| + t.boolean :global, default: false + t.datetime :expires + end + end +end diff --git a/db/migrate/20140424005439_create_delayed_jobs.rb b/db/migrate/20140424005439_create_delayed_jobs.rb new file mode 100644 index 0000000..ec0dd93 --- /dev/null +++ b/db/migrate/20140424005439_create_delayed_jobs.rb @@ -0,0 +1,22 @@ +class CreateDelayedJobs < ActiveRecord::Migration + def self.up + create_table :delayed_jobs, :force => true do |table| + table.integer :priority, :default => 0, :null => false # Allows some jobs to jump to the front of the queue + table.integer :attempts, :default => 0, :null => false # Provides for retries, but still fail eventually. + table.text :handler, :null => false # YAML-encoded string of the object that will do work + table.text :last_error # reason for last failure (See Note below) + table.datetime :run_at # When to run. Could be Time.zone.now for immediately, or sometime in the future. + table.datetime :locked_at # Set when a client is working on this object + table.datetime :failed_at # Set when all retries have failed (actually, by default, the record is deleted instead) + table.string :locked_by # Who is working on this object (if locked) + table.string :queue # The name of the queue this job is in + table.timestamps + end + + add_index :delayed_jobs, [:priority, :run_at], :name => 'delayed_jobs_priority' + end + + def self.down + drop_table :delayed_jobs + end +end diff --git a/db/migrate/20140424005442_create_servers.rb b/db/migrate/20140424005442_create_servers.rb new file mode 100644 index 0000000..fbe1b02 --- /dev/null +++ b/db/migrate/20140424005442_create_servers.rb @@ -0,0 +1,9 @@ +class CreateServers < ActiveRecord::Migration + def change + create_table :servers do |t| + t.integer :default_user_permissions + + t.timestamps + end + end +end diff --git a/db/migrate/20140424005445_create_matches.rb b/db/migrate/20140424005445_create_matches.rb new file mode 100644 index 0000000..bac92d1 --- /dev/null +++ b/db/migrate/20140424005445_create_matches.rb @@ -0,0 +1,13 @@ +class CreateMatches < ActiveRecord::Migration + def change + create_table :matches do |t| + t.integer :status + t.references :tournament_stage, index: true + t.references :winner, index: true + t.text :remote_id + t.integer :submitted_peer_evaluations + + t.timestamps + end + end +end diff --git a/db/migrate/20140424005448_create_teams.rb b/db/migrate/20140424005448_create_teams.rb new file mode 100644 index 0000000..dd8397d --- /dev/null +++ b/db/migrate/20140424005448_create_teams.rb @@ -0,0 +1,8 @@ +class CreateTeams < ActiveRecord::Migration + def change + create_table :teams do |t| + + t.timestamps + end + end +end diff --git a/db/migrate/20140424005451_create_alerts.rb b/db/migrate/20140424005451_create_alerts.rb new file mode 100644 index 0000000..68a8e10 --- /dev/null +++ b/db/migrate/20140424005451_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/20140424005454_create_pms.rb b/db/migrate/20140424005454_create_pms.rb new file mode 100644 index 0000000..93bb5c6 --- /dev/null +++ b/db/migrate/20140424005454_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/20140424005457_create_tournaments.rb b/db/migrate/20140424005457_create_tournaments.rb new file mode 100644 index 0000000..716871f --- /dev/null +++ b/db/migrate/20140424005457_create_tournaments.rb @@ -0,0 +1,19 @@ +class CreateTournaments < ActiveRecord::Migration + def change + create_table :tournaments do |t| + t.references :game, index: true + t.integer :status + t.string :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.string :sampling_method + + t.timestamps + end + add_index :tournaments, :name, unique: true + end +end diff --git a/db/migrate/20140424005500_create_games.rb b/db/migrate/20140424005500_create_games.rb new file mode 100644 index 0000000..46ed30d --- /dev/null +++ b/db/migrate/20140424005500_create_games.rb @@ -0,0 +1,17 @@ +class CreateGames < ActiveRecord::Migration + def change + create_table :games do |t| + t.string :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.string :sampling_method + + t.timestamps + end + add_index :games, :name, unique: true + end +end diff --git a/db/migrate/20140424005503_create_users.rb b/db/migrate/20140424005503_create_users.rb new file mode 100644 index 0000000..8032870 --- /dev/null +++ b/db/migrate/20140424005503_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/20140424005506_create_sessions.rb b/db/migrate/20140424005506_create_sessions.rb new file mode 100644 index 0000000..f667f1e --- /dev/null +++ b/db/migrate/20140424005506_create_sessions.rb @@ -0,0 +1,11 @@ +class CreateSessions < ActiveRecord::Migration + def change + create_table :sessions do |t| + t.references :user, index: true + t.string :token + + t.timestamps + end + add_index :sessions, :token, unique: true + end +end diff --git a/db/migrate/20140424005509_create_brackets.rb b/db/migrate/20140424005509_create_brackets.rb new file mode 100644 index 0000000..8813bf2 --- /dev/null +++ b/db/migrate/20140424005509_create_brackets.rb @@ -0,0 +1,11 @@ +class CreateBrackets < ActiveRecord::Migration + def change + create_table :brackets do |t| + t.references :user, index: true + t.references :tournament, index: true + t.string :name + + t.timestamps + end + end +end diff --git a/db/migrate/20140424005512_create_game_settings.rb b/db/migrate/20140424005512_create_game_settings.rb new file mode 100644 index 0000000..06fb72e --- /dev/null +++ b/db/migrate/20140424005512_create_game_settings.rb @@ -0,0 +1,15 @@ +class CreateGameSettings < ActiveRecord::Migration + def change + create_table :game_settings do |t| + t.references :game, index: true + t.string :name + t.integer :vartype + t.text :type_opt + t.text :description + t.integer :display_order + t.text :default + + t.timestamps + end + end +end diff --git a/db/migrate/20140424005515_create_tournament_settings.rb b/db/migrate/20140424005515_create_tournament_settings.rb new file mode 100644 index 0000000..e56697f --- /dev/null +++ b/db/migrate/20140424005515_create_tournament_settings.rb @@ -0,0 +1,15 @@ +class CreateTournamentSettings < ActiveRecord::Migration + def change + create_table :tournament_settings do |t| + t.references :tournament, index: true + t.string :name + t.integer :vartype + t.text :type_opt + t.text :description + t.integer :display_order + t.text :value + + t.timestamps + end + end +end diff --git a/db/migrate/20140424005519_create_tournament_stages.rb b/db/migrate/20140424005519_create_tournament_stages.rb new file mode 100644 index 0000000..e3668cb --- /dev/null +++ b/db/migrate/20140424005519_create_tournament_stages.rb @@ -0,0 +1,11 @@ +class CreateTournamentStages < ActiveRecord::Migration + def change + create_table :tournament_stages do |t| + t.references :tournament, index: true + t.string :scheduling + t.text :structure + + t.timestamps + end + end +end diff --git a/db/migrate/20140424005523_create_statistics.rb b/db/migrate/20140424005523_create_statistics.rb new file mode 100644 index 0000000..cc2e97d --- /dev/null +++ b/db/migrate/20140424005523_create_statistics.rb @@ -0,0 +1,12 @@ +class CreateStatistics < ActiveRecord::Migration + def change + create_table :statistics do |t| + t.references :user, index: true + t.references :match, index: true + t.string :name + t.integer :value + + t.timestamps + end + end +end diff --git a/db/migrate/20140424005527_create_remote_usernames.rb b/db/migrate/20140424005527_create_remote_usernames.rb new file mode 100644 index 0000000..e265985 --- /dev/null +++ b/db/migrate/20140424005527_create_remote_usernames.rb @@ -0,0 +1,11 @@ +class CreateRemoteUsernames < ActiveRecord::Migration + def change + create_table :remote_usernames do |t| + t.references :game, index: true + t.references :user, index: true + t.text :json_value + + t.timestamps + end + end +end diff --git a/db/migrate/20140424005530_create_bracket_matches.rb b/db/migrate/20140424005530_create_bracket_matches.rb new file mode 100644 index 0000000..3323e31 --- /dev/null +++ b/db/migrate/20140424005530_create_bracket_matches.rb @@ -0,0 +1,11 @@ +class CreateBracketMatches < ActiveRecord::Migration + def change + create_table :bracket_matches do |t| + t.references :bracket, index: true + t.references :match, index: true + t.references :predicted_winner, index: true + + t.timestamps + end + end +end diff --git a/db/migrate/20140424005533_create_api_requests.rb b/db/migrate/20140424005533_create_api_requests.rb new file mode 100644 index 0000000..544c330 --- /dev/null +++ b/db/migrate/20140424005533_create_api_requests.rb @@ -0,0 +1,9 @@ +class CreateApiRequests < ActiveRecord::Migration + def change + create_table :api_requests do |t| + t.string :api_name + + t.timestamps + end + end +end diff --git a/db/migrate/20140424005536_create_tournament_players_join_table.rb b/db/migrate/20140424005536_create_tournament_players_join_table.rb new file mode 100644 index 0000000..be240e8 --- /dev/null +++ b/db/migrate/20140424005536_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/20140424005539_create_tournament_hosts_join_table.rb b/db/migrate/20140424005539_create_tournament_hosts_join_table.rb new file mode 100644 index 0000000..7521d89 --- /dev/null +++ b/db/migrate/20140424005539_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/20140424005542_create_team_user_join_table.rb b/db/migrate/20140424005542_create_team_user_join_table.rb new file mode 100644 index 0000000..f3b57fc --- /dev/null +++ b/db/migrate/20140424005542_create_team_user_join_table.rb @@ -0,0 +1,8 @@ +class CreateTeamUserJoinTable < ActiveRecord::Migration + def change + create_join_table :teams, :users do |t| + # t.index [:team_id, :user_id] + # t.index [:user_id, :team_id] + end + end +end diff --git a/db/migrate/20140424005544_create_match_team_join_table.rb b/db/migrate/20140424005544_create_match_team_join_table.rb new file mode 100644 index 0000000..c2ed1b7 --- /dev/null +++ b/db/migrate/20140424005544_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/20140424005552_add_hidden_attrs_to_user.rb b/db/migrate/20140424005552_add_hidden_attrs_to_user.rb new file mode 100644 index 0000000..9b5c505 --- /dev/null +++ b/db/migrate/20140424005552_add_hidden_attrs_to_user.rb @@ -0,0 +1,6 @@ +class AddHiddenAttrsToUser < ActiveRecord::Migration + def change + add_column :users, :password_digest, :string + add_column :users, :permissions, :integer + end +end diff --git a/db/schema.rb b/db/schema.rb index a160f22..c014e84 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: 20140422212727) do +ActiveRecord::Schema.define(version: 20140424005552) do create_table "alerts", force: true do |t| t.integer "author_id" -- cgit v1.2.3-2-g168b From d1dbfb1dcd4810f538826fa5e448bdda0998b38e Mon Sep 17 00:00:00 2001 From: DavisLWebb Date: Wed, 23 Apr 2014 21:33:49 -0400 Subject: run ./generate.sh --- .../20140423205436_create_simple_captcha_data.rb | 15 ------ .../20140423213222_create_simple_captcha_data.rb | 15 ++++++ ...0424005433_create_mailboxer.mailboxer_engine.rb | 62 ---------------------- ...4005434_add_notified_object.mailboxer_engine.rb | 18 ------- ...05435_add_notification_code.mailboxer_engine.rb | 14 ----- ...40424005436_add_attachments.mailboxer_engine.rb | 10 ---- ...005437_rename_receipts_read.mailboxer_engine.rb | 10 ---- ...global_notification_support.mailboxer_engine.rb | 10 ---- db/migrate/20140424005439_create_delayed_jobs.rb | 22 -------- db/migrate/20140424005442_create_servers.rb | 9 ---- db/migrate/20140424005445_create_matches.rb | 13 ----- db/migrate/20140424005448_create_teams.rb | 8 --- db/migrate/20140424005451_create_alerts.rb | 10 ---- db/migrate/20140424005454_create_pms.rb | 11 ---- db/migrate/20140424005457_create_tournaments.rb | 19 ------- db/migrate/20140424005500_create_games.rb | 17 ------ db/migrate/20140424005503_create_users.rb | 13 ----- db/migrate/20140424005506_create_sessions.rb | 11 ---- db/migrate/20140424005509_create_brackets.rb | 11 ---- db/migrate/20140424005512_create_game_settings.rb | 15 ------ .../20140424005515_create_tournament_settings.rb | 15 ------ .../20140424005519_create_tournament_stages.rb | 11 ---- db/migrate/20140424005523_create_statistics.rb | 12 ----- .../20140424005527_create_remote_usernames.rb | 11 ---- .../20140424005530_create_bracket_matches.rb | 11 ---- db/migrate/20140424005533_create_api_requests.rb | 9 ---- ...4005536_create_tournament_players_join_table.rb | 8 --- ...424005539_create_tournament_hosts_join_table.rb | 8 --- .../20140424005542_create_team_user_join_table.rb | 8 --- .../20140424005544_create_match_team_join_table.rb | 8 --- .../20140424005552_add_hidden_attrs_to_user.rb | 6 --- ...0424013221_create_mailboxer.mailboxer_engine.rb | 62 ++++++++++++++++++++++ ...4013222_add_notified_object.mailboxer_engine.rb | 18 +++++++ ...13223_add_notification_code.mailboxer_engine.rb | 14 +++++ ...40424013224_add_attachments.mailboxer_engine.rb | 10 ++++ ...013225_rename_receipts_read.mailboxer_engine.rb | 10 ++++ ...global_notification_support.mailboxer_engine.rb | 10 ++++ db/migrate/20140424013227_create_delayed_jobs.rb | 22 ++++++++ db/migrate/20140424013228_create_servers.rb | 9 ++++ db/migrate/20140424013229_create_matches.rb | 13 +++++ db/migrate/20140424013230_create_teams.rb | 8 +++ db/migrate/20140424013231_create_alerts.rb | 10 ++++ db/migrate/20140424013232_create_pms.rb | 11 ++++ db/migrate/20140424013233_create_tournaments.rb | 19 +++++++ db/migrate/20140424013234_create_games.rb | 17 ++++++ db/migrate/20140424013236_create_users.rb | 13 +++++ db/migrate/20140424013237_create_sessions.rb | 11 ++++ db/migrate/20140424013239_create_brackets.rb | 11 ++++ db/migrate/20140424013241_create_game_settings.rb | 16 ++++++ .../20140424013242_create_tournament_settings.rb | 15 ++++++ .../20140424013244_create_tournament_stages.rb | 11 ++++ db/migrate/20140424013245_create_statistics.rb | 12 +++++ .../20140424013247_create_remote_usernames.rb | 11 ++++ .../20140424013248_create_bracket_matches.rb | 11 ++++ db/migrate/20140424013250_create_api_requests.rb | 9 ++++ ...4013251_create_tournament_players_join_table.rb | 8 +++ ...424013253_create_tournament_hosts_join_table.rb | 8 +++ .../20140424013254_create_team_user_join_table.rb | 8 +++ .../20140424013256_create_match_team_join_table.rb | 8 +++ .../20140424013300_add_hidden_attrs_to_user.rb | 6 +++ db/schema.rb | 4 +- 61 files changed, 409 insertions(+), 406 deletions(-) delete mode 100644 db/migrate/20140423205436_create_simple_captcha_data.rb create mode 100644 db/migrate/20140423213222_create_simple_captcha_data.rb delete mode 100644 db/migrate/20140424005433_create_mailboxer.mailboxer_engine.rb delete mode 100644 db/migrate/20140424005434_add_notified_object.mailboxer_engine.rb delete mode 100644 db/migrate/20140424005435_add_notification_code.mailboxer_engine.rb delete mode 100644 db/migrate/20140424005436_add_attachments.mailboxer_engine.rb delete mode 100644 db/migrate/20140424005437_rename_receipts_read.mailboxer_engine.rb delete mode 100644 db/migrate/20140424005438_add_global_notification_support.mailboxer_engine.rb delete mode 100644 db/migrate/20140424005439_create_delayed_jobs.rb delete mode 100644 db/migrate/20140424005442_create_servers.rb delete mode 100644 db/migrate/20140424005445_create_matches.rb delete mode 100644 db/migrate/20140424005448_create_teams.rb delete mode 100644 db/migrate/20140424005451_create_alerts.rb delete mode 100644 db/migrate/20140424005454_create_pms.rb delete mode 100644 db/migrate/20140424005457_create_tournaments.rb delete mode 100644 db/migrate/20140424005500_create_games.rb delete mode 100644 db/migrate/20140424005503_create_users.rb delete mode 100644 db/migrate/20140424005506_create_sessions.rb delete mode 100644 db/migrate/20140424005509_create_brackets.rb delete mode 100644 db/migrate/20140424005512_create_game_settings.rb delete mode 100644 db/migrate/20140424005515_create_tournament_settings.rb delete mode 100644 db/migrate/20140424005519_create_tournament_stages.rb delete mode 100644 db/migrate/20140424005523_create_statistics.rb delete mode 100644 db/migrate/20140424005527_create_remote_usernames.rb delete mode 100644 db/migrate/20140424005530_create_bracket_matches.rb delete mode 100644 db/migrate/20140424005533_create_api_requests.rb delete mode 100644 db/migrate/20140424005536_create_tournament_players_join_table.rb delete mode 100644 db/migrate/20140424005539_create_tournament_hosts_join_table.rb delete mode 100644 db/migrate/20140424005542_create_team_user_join_table.rb delete mode 100644 db/migrate/20140424005544_create_match_team_join_table.rb delete mode 100644 db/migrate/20140424005552_add_hidden_attrs_to_user.rb create mode 100644 db/migrate/20140424013221_create_mailboxer.mailboxer_engine.rb create mode 100644 db/migrate/20140424013222_add_notified_object.mailboxer_engine.rb create mode 100644 db/migrate/20140424013223_add_notification_code.mailboxer_engine.rb create mode 100644 db/migrate/20140424013224_add_attachments.mailboxer_engine.rb create mode 100644 db/migrate/20140424013225_rename_receipts_read.mailboxer_engine.rb create mode 100644 db/migrate/20140424013226_add_global_notification_support.mailboxer_engine.rb create mode 100644 db/migrate/20140424013227_create_delayed_jobs.rb create mode 100644 db/migrate/20140424013228_create_servers.rb create mode 100644 db/migrate/20140424013229_create_matches.rb create mode 100644 db/migrate/20140424013230_create_teams.rb create mode 100644 db/migrate/20140424013231_create_alerts.rb create mode 100644 db/migrate/20140424013232_create_pms.rb create mode 100644 db/migrate/20140424013233_create_tournaments.rb create mode 100644 db/migrate/20140424013234_create_games.rb create mode 100644 db/migrate/20140424013236_create_users.rb create mode 100644 db/migrate/20140424013237_create_sessions.rb create mode 100644 db/migrate/20140424013239_create_brackets.rb create mode 100644 db/migrate/20140424013241_create_game_settings.rb create mode 100644 db/migrate/20140424013242_create_tournament_settings.rb create mode 100644 db/migrate/20140424013244_create_tournament_stages.rb create mode 100644 db/migrate/20140424013245_create_statistics.rb create mode 100644 db/migrate/20140424013247_create_remote_usernames.rb create mode 100644 db/migrate/20140424013248_create_bracket_matches.rb create mode 100644 db/migrate/20140424013250_create_api_requests.rb create mode 100644 db/migrate/20140424013251_create_tournament_players_join_table.rb create mode 100644 db/migrate/20140424013253_create_tournament_hosts_join_table.rb create mode 100644 db/migrate/20140424013254_create_team_user_join_table.rb create mode 100644 db/migrate/20140424013256_create_match_team_join_table.rb create mode 100644 db/migrate/20140424013300_add_hidden_attrs_to_user.rb (limited to 'db') diff --git a/db/migrate/20140423205436_create_simple_captcha_data.rb b/db/migrate/20140423205436_create_simple_captcha_data.rb deleted file mode 100644 index 4573b20..0000000 --- a/db/migrate/20140423205436_create_simple_captcha_data.rb +++ /dev/null @@ -1,15 +0,0 @@ -class CreateSimpleCaptchaData < ActiveRecord::Migration - def self.up - create_table :simple_captcha_data do |t| - t.string :key, :limit => 40 - t.string :value, :limit => 6 - t.timestamps - end - - add_index :simple_captcha_data, :key, :name => "idx_key" - end - - def self.down - drop_table :simple_captcha_data - end -end diff --git a/db/migrate/20140423213222_create_simple_captcha_data.rb b/db/migrate/20140423213222_create_simple_captcha_data.rb new file mode 100644 index 0000000..4573b20 --- /dev/null +++ b/db/migrate/20140423213222_create_simple_captcha_data.rb @@ -0,0 +1,15 @@ +class CreateSimpleCaptchaData < ActiveRecord::Migration + def self.up + create_table :simple_captcha_data do |t| + t.string :key, :limit => 40 + t.string :value, :limit => 6 + t.timestamps + end + + add_index :simple_captcha_data, :key, :name => "idx_key" + end + + def self.down + drop_table :simple_captcha_data + end +end diff --git a/db/migrate/20140424005433_create_mailboxer.mailboxer_engine.rb b/db/migrate/20140424005433_create_mailboxer.mailboxer_engine.rb deleted file mode 100644 index 690cec2..0000000 --- a/db/migrate/20140424005433_create_mailboxer.mailboxer_engine.rb +++ /dev/null @@ -1,62 +0,0 @@ -# This migration comes from mailboxer_engine (originally 20110511145103) -class CreateMailboxer < ActiveRecord::Migration - def self.up - #Tables - #Conversations - create_table :conversations do |t| - t.column :subject, :string, :default => "" - t.column :created_at, :datetime, :null => false - t.column :updated_at, :datetime, :null => false - end - #Receipts - create_table :receipts do |t| - t.references :receiver, :polymorphic => true - t.column :notification_id, :integer, :null => false - t.column :read, :boolean, :default => false - t.column :trashed, :boolean, :default => false - t.column :deleted, :boolean, :default => false - t.column :mailbox_type, :string, :limit => 25 - t.column :created_at, :datetime, :null => false - t.column :updated_at, :datetime, :null => false - end - #Notifications and Messages - create_table :notifications do |t| - t.column :type, :string - t.column :body, :text - t.column :subject, :string, :default => "" - t.references :sender, :polymorphic => true - t.references :object, :polymorphic => true - t.column :conversation_id, :integer - t.column :draft, :boolean, :default => false - t.column :updated_at, :datetime, :null => false - t.column :created_at, :datetime, :null => false - end - - - #Indexes - #Conversations - #Receipts - add_index "receipts","notification_id" - - #Messages - add_index "notifications","conversation_id" - - #Foreign keys - #Conversations - #Receipts - add_foreign_key "receipts", "notifications", :name => "receipts_on_notification_id" - #Messages - add_foreign_key "notifications", "conversations", :name => "notifications_on_conversation_id" - end - - def self.down - #Tables - remove_foreign_key "receipts", :name => "receipts_on_notification_id" - remove_foreign_key "notifications", :name => "notifications_on_conversation_id" - - #Indexes - drop_table :receipts - drop_table :conversations - drop_table :notifications - end -end diff --git a/db/migrate/20140424005434_add_notified_object.mailboxer_engine.rb b/db/migrate/20140424005434_add_notified_object.mailboxer_engine.rb deleted file mode 100644 index 7f41ac6..0000000 --- a/db/migrate/20140424005434_add_notified_object.mailboxer_engine.rb +++ /dev/null @@ -1,18 +0,0 @@ -# This migration comes from mailboxer_engine (originally 20110719110700) -class AddNotifiedObject < ActiveRecord::Migration - def self.up - change_table :notifications do |t| - t.references :notified_object, :polymorphic => true - t.remove :object_id - t.remove :object_type - end - end - - def self.down - change_table :notifications do |t| - t.remove :notified_object_id - t.remove :notified_object_type - t.references :object, :polymorphic => true - end - end -end diff --git a/db/migrate/20140424005435_add_notification_code.mailboxer_engine.rb b/db/migrate/20140424005435_add_notification_code.mailboxer_engine.rb deleted file mode 100644 index 04c12ef..0000000 --- a/db/migrate/20140424005435_add_notification_code.mailboxer_engine.rb +++ /dev/null @@ -1,14 +0,0 @@ -# This migration comes from mailboxer_engine (originally 20110912163911) -class AddNotificationCode < ActiveRecord::Migration - def self.up - change_table :notifications do |t| - t.string :notification_code, :default => nil - end - end - - def self.down - change_table :notifications do |t| - t.remove :notification_code - end - end -end \ No newline at end of file diff --git a/db/migrate/20140424005436_add_attachments.mailboxer_engine.rb b/db/migrate/20140424005436_add_attachments.mailboxer_engine.rb deleted file mode 100644 index b8d6588..0000000 --- a/db/migrate/20140424005436_add_attachments.mailboxer_engine.rb +++ /dev/null @@ -1,10 +0,0 @@ -# This migration comes from mailboxer_engine (originally 20111204163911) -class AddAttachments < ActiveRecord::Migration - def self.up - add_column :notifications, :attachment, :string - end - - def self.down - remove_column :notifications, :attachment - end -end diff --git a/db/migrate/20140424005437_rename_receipts_read.mailboxer_engine.rb b/db/migrate/20140424005437_rename_receipts_read.mailboxer_engine.rb deleted file mode 100644 index 9ce904f..0000000 --- a/db/migrate/20140424005437_rename_receipts_read.mailboxer_engine.rb +++ /dev/null @@ -1,10 +0,0 @@ -# This migration comes from mailboxer_engine (originally 20120813110712) -class RenameReceiptsRead < ActiveRecord::Migration - def up - rename_column :receipts, :read, :is_read - end - - def down - rename_column :receipts, :is_read, :read - end -end diff --git a/db/migrate/20140424005438_add_global_notification_support.mailboxer_engine.rb b/db/migrate/20140424005438_add_global_notification_support.mailboxer_engine.rb deleted file mode 100644 index 60f67ab..0000000 --- a/db/migrate/20140424005438_add_global_notification_support.mailboxer_engine.rb +++ /dev/null @@ -1,10 +0,0 @@ -# This migration comes from mailboxer_engine (originally 20130305144212) -class AddGlobalNotificationSupport < ActiveRecord::Migration - - def change - change_table :notifications do |t| - t.boolean :global, default: false - t.datetime :expires - end - end -end diff --git a/db/migrate/20140424005439_create_delayed_jobs.rb b/db/migrate/20140424005439_create_delayed_jobs.rb deleted file mode 100644 index ec0dd93..0000000 --- a/db/migrate/20140424005439_create_delayed_jobs.rb +++ /dev/null @@ -1,22 +0,0 @@ -class CreateDelayedJobs < ActiveRecord::Migration - def self.up - create_table :delayed_jobs, :force => true do |table| - table.integer :priority, :default => 0, :null => false # Allows some jobs to jump to the front of the queue - table.integer :attempts, :default => 0, :null => false # Provides for retries, but still fail eventually. - table.text :handler, :null => false # YAML-encoded string of the object that will do work - table.text :last_error # reason for last failure (See Note below) - table.datetime :run_at # When to run. Could be Time.zone.now for immediately, or sometime in the future. - table.datetime :locked_at # Set when a client is working on this object - table.datetime :failed_at # Set when all retries have failed (actually, by default, the record is deleted instead) - table.string :locked_by # Who is working on this object (if locked) - table.string :queue # The name of the queue this job is in - table.timestamps - end - - add_index :delayed_jobs, [:priority, :run_at], :name => 'delayed_jobs_priority' - end - - def self.down - drop_table :delayed_jobs - end -end diff --git a/db/migrate/20140424005442_create_servers.rb b/db/migrate/20140424005442_create_servers.rb deleted file mode 100644 index fbe1b02..0000000 --- a/db/migrate/20140424005442_create_servers.rb +++ /dev/null @@ -1,9 +0,0 @@ -class CreateServers < ActiveRecord::Migration - def change - create_table :servers do |t| - t.integer :default_user_permissions - - t.timestamps - end - end -end diff --git a/db/migrate/20140424005445_create_matches.rb b/db/migrate/20140424005445_create_matches.rb deleted file mode 100644 index bac92d1..0000000 --- a/db/migrate/20140424005445_create_matches.rb +++ /dev/null @@ -1,13 +0,0 @@ -class CreateMatches < ActiveRecord::Migration - def change - create_table :matches do |t| - t.integer :status - t.references :tournament_stage, index: true - t.references :winner, index: true - t.text :remote_id - t.integer :submitted_peer_evaluations - - t.timestamps - end - end -end diff --git a/db/migrate/20140424005448_create_teams.rb b/db/migrate/20140424005448_create_teams.rb deleted file mode 100644 index dd8397d..0000000 --- a/db/migrate/20140424005448_create_teams.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateTeams < ActiveRecord::Migration - def change - create_table :teams do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140424005451_create_alerts.rb b/db/migrate/20140424005451_create_alerts.rb deleted file mode 100644 index 68a8e10..0000000 --- a/db/migrate/20140424005451_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/20140424005454_create_pms.rb b/db/migrate/20140424005454_create_pms.rb deleted file mode 100644 index 93bb5c6..0000000 --- a/db/migrate/20140424005454_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/20140424005457_create_tournaments.rb b/db/migrate/20140424005457_create_tournaments.rb deleted file mode 100644 index 716871f..0000000 --- a/db/migrate/20140424005457_create_tournaments.rb +++ /dev/null @@ -1,19 +0,0 @@ -class CreateTournaments < ActiveRecord::Migration - def change - create_table :tournaments do |t| - t.references :game, index: true - t.integer :status - t.string :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.string :sampling_method - - t.timestamps - end - add_index :tournaments, :name, unique: true - end -end diff --git a/db/migrate/20140424005500_create_games.rb b/db/migrate/20140424005500_create_games.rb deleted file mode 100644 index 46ed30d..0000000 --- a/db/migrate/20140424005500_create_games.rb +++ /dev/null @@ -1,17 +0,0 @@ -class CreateGames < ActiveRecord::Migration - def change - create_table :games do |t| - t.string :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.string :sampling_method - - t.timestamps - end - add_index :games, :name, unique: true - end -end diff --git a/db/migrate/20140424005503_create_users.rb b/db/migrate/20140424005503_create_users.rb deleted file mode 100644 index 8032870..0000000 --- a/db/migrate/20140424005503_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/20140424005506_create_sessions.rb b/db/migrate/20140424005506_create_sessions.rb deleted file mode 100644 index f667f1e..0000000 --- a/db/migrate/20140424005506_create_sessions.rb +++ /dev/null @@ -1,11 +0,0 @@ -class CreateSessions < ActiveRecord::Migration - def change - create_table :sessions do |t| - t.references :user, index: true - t.string :token - - t.timestamps - end - add_index :sessions, :token, unique: true - end -end diff --git a/db/migrate/20140424005509_create_brackets.rb b/db/migrate/20140424005509_create_brackets.rb deleted file mode 100644 index 8813bf2..0000000 --- a/db/migrate/20140424005509_create_brackets.rb +++ /dev/null @@ -1,11 +0,0 @@ -class CreateBrackets < ActiveRecord::Migration - def change - create_table :brackets do |t| - t.references :user, index: true - t.references :tournament, index: true - t.string :name - - t.timestamps - end - end -end diff --git a/db/migrate/20140424005512_create_game_settings.rb b/db/migrate/20140424005512_create_game_settings.rb deleted file mode 100644 index 06fb72e..0000000 --- a/db/migrate/20140424005512_create_game_settings.rb +++ /dev/null @@ -1,15 +0,0 @@ -class CreateGameSettings < ActiveRecord::Migration - def change - create_table :game_settings do |t| - t.references :game, index: true - t.string :name - t.integer :vartype - t.text :type_opt - t.text :description - t.integer :display_order - t.text :default - - t.timestamps - end - end -end diff --git a/db/migrate/20140424005515_create_tournament_settings.rb b/db/migrate/20140424005515_create_tournament_settings.rb deleted file mode 100644 index e56697f..0000000 --- a/db/migrate/20140424005515_create_tournament_settings.rb +++ /dev/null @@ -1,15 +0,0 @@ -class CreateTournamentSettings < ActiveRecord::Migration - def change - create_table :tournament_settings do |t| - t.references :tournament, index: true - t.string :name - t.integer :vartype - t.text :type_opt - t.text :description - t.integer :display_order - t.text :value - - t.timestamps - end - end -end diff --git a/db/migrate/20140424005519_create_tournament_stages.rb b/db/migrate/20140424005519_create_tournament_stages.rb deleted file mode 100644 index e3668cb..0000000 --- a/db/migrate/20140424005519_create_tournament_stages.rb +++ /dev/null @@ -1,11 +0,0 @@ -class CreateTournamentStages < ActiveRecord::Migration - def change - create_table :tournament_stages do |t| - t.references :tournament, index: true - t.string :scheduling - t.text :structure - - t.timestamps - end - end -end diff --git a/db/migrate/20140424005523_create_statistics.rb b/db/migrate/20140424005523_create_statistics.rb deleted file mode 100644 index cc2e97d..0000000 --- a/db/migrate/20140424005523_create_statistics.rb +++ /dev/null @@ -1,12 +0,0 @@ -class CreateStatistics < ActiveRecord::Migration - def change - create_table :statistics do |t| - t.references :user, index: true - t.references :match, index: true - t.string :name - t.integer :value - - t.timestamps - end - end -end diff --git a/db/migrate/20140424005527_create_remote_usernames.rb b/db/migrate/20140424005527_create_remote_usernames.rb deleted file mode 100644 index e265985..0000000 --- a/db/migrate/20140424005527_create_remote_usernames.rb +++ /dev/null @@ -1,11 +0,0 @@ -class CreateRemoteUsernames < ActiveRecord::Migration - def change - create_table :remote_usernames do |t| - t.references :game, index: true - t.references :user, index: true - t.text :json_value - - t.timestamps - end - end -end diff --git a/db/migrate/20140424005530_create_bracket_matches.rb b/db/migrate/20140424005530_create_bracket_matches.rb deleted file mode 100644 index 3323e31..0000000 --- a/db/migrate/20140424005530_create_bracket_matches.rb +++ /dev/null @@ -1,11 +0,0 @@ -class CreateBracketMatches < ActiveRecord::Migration - def change - create_table :bracket_matches do |t| - t.references :bracket, index: true - t.references :match, index: true - t.references :predicted_winner, index: true - - t.timestamps - end - end -end diff --git a/db/migrate/20140424005533_create_api_requests.rb b/db/migrate/20140424005533_create_api_requests.rb deleted file mode 100644 index 544c330..0000000 --- a/db/migrate/20140424005533_create_api_requests.rb +++ /dev/null @@ -1,9 +0,0 @@ -class CreateApiRequests < ActiveRecord::Migration - def change - create_table :api_requests do |t| - t.string :api_name - - t.timestamps - end - end -end diff --git a/db/migrate/20140424005536_create_tournament_players_join_table.rb b/db/migrate/20140424005536_create_tournament_players_join_table.rb deleted file mode 100644 index be240e8..0000000 --- a/db/migrate/20140424005536_create_tournament_players_join_table.rb +++ /dev/null @@ -1,8 +0,0 @@ -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/20140424005539_create_tournament_hosts_join_table.rb b/db/migrate/20140424005539_create_tournament_hosts_join_table.rb deleted file mode 100644 index 7521d89..0000000 --- a/db/migrate/20140424005539_create_tournament_hosts_join_table.rb +++ /dev/null @@ -1,8 +0,0 @@ -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/20140424005542_create_team_user_join_table.rb b/db/migrate/20140424005542_create_team_user_join_table.rb deleted file mode 100644 index f3b57fc..0000000 --- a/db/migrate/20140424005542_create_team_user_join_table.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateTeamUserJoinTable < ActiveRecord::Migration - def change - create_join_table :teams, :users do |t| - # t.index [:team_id, :user_id] - # t.index [:user_id, :team_id] - end - end -end diff --git a/db/migrate/20140424005544_create_match_team_join_table.rb b/db/migrate/20140424005544_create_match_team_join_table.rb deleted file mode 100644 index c2ed1b7..0000000 --- a/db/migrate/20140424005544_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/20140424005552_add_hidden_attrs_to_user.rb b/db/migrate/20140424005552_add_hidden_attrs_to_user.rb deleted file mode 100644 index 9b5c505..0000000 --- a/db/migrate/20140424005552_add_hidden_attrs_to_user.rb +++ /dev/null @@ -1,6 +0,0 @@ -class AddHiddenAttrsToUser < ActiveRecord::Migration - def change - add_column :users, :password_digest, :string - add_column :users, :permissions, :integer - end -end diff --git a/db/migrate/20140424013221_create_mailboxer.mailboxer_engine.rb b/db/migrate/20140424013221_create_mailboxer.mailboxer_engine.rb new file mode 100644 index 0000000..690cec2 --- /dev/null +++ b/db/migrate/20140424013221_create_mailboxer.mailboxer_engine.rb @@ -0,0 +1,62 @@ +# This migration comes from mailboxer_engine (originally 20110511145103) +class CreateMailboxer < ActiveRecord::Migration + def self.up + #Tables + #Conversations + create_table :conversations do |t| + t.column :subject, :string, :default => "" + t.column :created_at, :datetime, :null => false + t.column :updated_at, :datetime, :null => false + end + #Receipts + create_table :receipts do |t| + t.references :receiver, :polymorphic => true + t.column :notification_id, :integer, :null => false + t.column :read, :boolean, :default => false + t.column :trashed, :boolean, :default => false + t.column :deleted, :boolean, :default => false + t.column :mailbox_type, :string, :limit => 25 + t.column :created_at, :datetime, :null => false + t.column :updated_at, :datetime, :null => false + end + #Notifications and Messages + create_table :notifications do |t| + t.column :type, :string + t.column :body, :text + t.column :subject, :string, :default => "" + t.references :sender, :polymorphic => true + t.references :object, :polymorphic => true + t.column :conversation_id, :integer + t.column :draft, :boolean, :default => false + t.column :updated_at, :datetime, :null => false + t.column :created_at, :datetime, :null => false + end + + + #Indexes + #Conversations + #Receipts + add_index "receipts","notification_id" + + #Messages + add_index "notifications","conversation_id" + + #Foreign keys + #Conversations + #Receipts + add_foreign_key "receipts", "notifications", :name => "receipts_on_notification_id" + #Messages + add_foreign_key "notifications", "conversations", :name => "notifications_on_conversation_id" + end + + def self.down + #Tables + remove_foreign_key "receipts", :name => "receipts_on_notification_id" + remove_foreign_key "notifications", :name => "notifications_on_conversation_id" + + #Indexes + drop_table :receipts + drop_table :conversations + drop_table :notifications + end +end diff --git a/db/migrate/20140424013222_add_notified_object.mailboxer_engine.rb b/db/migrate/20140424013222_add_notified_object.mailboxer_engine.rb new file mode 100644 index 0000000..7f41ac6 --- /dev/null +++ b/db/migrate/20140424013222_add_notified_object.mailboxer_engine.rb @@ -0,0 +1,18 @@ +# This migration comes from mailboxer_engine (originally 20110719110700) +class AddNotifiedObject < ActiveRecord::Migration + def self.up + change_table :notifications do |t| + t.references :notified_object, :polymorphic => true + t.remove :object_id + t.remove :object_type + end + end + + def self.down + change_table :notifications do |t| + t.remove :notified_object_id + t.remove :notified_object_type + t.references :object, :polymorphic => true + end + end +end diff --git a/db/migrate/20140424013223_add_notification_code.mailboxer_engine.rb b/db/migrate/20140424013223_add_notification_code.mailboxer_engine.rb new file mode 100644 index 0000000..04c12ef --- /dev/null +++ b/db/migrate/20140424013223_add_notification_code.mailboxer_engine.rb @@ -0,0 +1,14 @@ +# This migration comes from mailboxer_engine (originally 20110912163911) +class AddNotificationCode < ActiveRecord::Migration + def self.up + change_table :notifications do |t| + t.string :notification_code, :default => nil + end + end + + def self.down + change_table :notifications do |t| + t.remove :notification_code + end + end +end \ No newline at end of file diff --git a/db/migrate/20140424013224_add_attachments.mailboxer_engine.rb b/db/migrate/20140424013224_add_attachments.mailboxer_engine.rb new file mode 100644 index 0000000..b8d6588 --- /dev/null +++ b/db/migrate/20140424013224_add_attachments.mailboxer_engine.rb @@ -0,0 +1,10 @@ +# This migration comes from mailboxer_engine (originally 20111204163911) +class AddAttachments < ActiveRecord::Migration + def self.up + add_column :notifications, :attachment, :string + end + + def self.down + remove_column :notifications, :attachment + end +end diff --git a/db/migrate/20140424013225_rename_receipts_read.mailboxer_engine.rb b/db/migrate/20140424013225_rename_receipts_read.mailboxer_engine.rb new file mode 100644 index 0000000..9ce904f --- /dev/null +++ b/db/migrate/20140424013225_rename_receipts_read.mailboxer_engine.rb @@ -0,0 +1,10 @@ +# This migration comes from mailboxer_engine (originally 20120813110712) +class RenameReceiptsRead < ActiveRecord::Migration + def up + rename_column :receipts, :read, :is_read + end + + def down + rename_column :receipts, :is_read, :read + end +end diff --git a/db/migrate/20140424013226_add_global_notification_support.mailboxer_engine.rb b/db/migrate/20140424013226_add_global_notification_support.mailboxer_engine.rb new file mode 100644 index 0000000..60f67ab --- /dev/null +++ b/db/migrate/20140424013226_add_global_notification_support.mailboxer_engine.rb @@ -0,0 +1,10 @@ +# This migration comes from mailboxer_engine (originally 20130305144212) +class AddGlobalNotificationSupport < ActiveRecord::Migration + + def change + change_table :notifications do |t| + t.boolean :global, default: false + t.datetime :expires + end + end +end diff --git a/db/migrate/20140424013227_create_delayed_jobs.rb b/db/migrate/20140424013227_create_delayed_jobs.rb new file mode 100644 index 0000000..ec0dd93 --- /dev/null +++ b/db/migrate/20140424013227_create_delayed_jobs.rb @@ -0,0 +1,22 @@ +class CreateDelayedJobs < ActiveRecord::Migration + def self.up + create_table :delayed_jobs, :force => true do |table| + table.integer :priority, :default => 0, :null => false # Allows some jobs to jump to the front of the queue + table.integer :attempts, :default => 0, :null => false # Provides for retries, but still fail eventually. + table.text :handler, :null => false # YAML-encoded string of the object that will do work + table.text :last_error # reason for last failure (See Note below) + table.datetime :run_at # When to run. Could be Time.zone.now for immediately, or sometime in the future. + table.datetime :locked_at # Set when a client is working on this object + table.datetime :failed_at # Set when all retries have failed (actually, by default, the record is deleted instead) + table.string :locked_by # Who is working on this object (if locked) + table.string :queue # The name of the queue this job is in + table.timestamps + end + + add_index :delayed_jobs, [:priority, :run_at], :name => 'delayed_jobs_priority' + end + + def self.down + drop_table :delayed_jobs + end +end diff --git a/db/migrate/20140424013228_create_servers.rb b/db/migrate/20140424013228_create_servers.rb new file mode 100644 index 0000000..fbe1b02 --- /dev/null +++ b/db/migrate/20140424013228_create_servers.rb @@ -0,0 +1,9 @@ +class CreateServers < ActiveRecord::Migration + def change + create_table :servers do |t| + t.integer :default_user_permissions + + t.timestamps + end + end +end diff --git a/db/migrate/20140424013229_create_matches.rb b/db/migrate/20140424013229_create_matches.rb new file mode 100644 index 0000000..bac92d1 --- /dev/null +++ b/db/migrate/20140424013229_create_matches.rb @@ -0,0 +1,13 @@ +class CreateMatches < ActiveRecord::Migration + def change + create_table :matches do |t| + t.integer :status + t.references :tournament_stage, index: true + t.references :winner, index: true + t.text :remote_id + t.integer :submitted_peer_evaluations + + t.timestamps + end + end +end diff --git a/db/migrate/20140424013230_create_teams.rb b/db/migrate/20140424013230_create_teams.rb new file mode 100644 index 0000000..dd8397d --- /dev/null +++ b/db/migrate/20140424013230_create_teams.rb @@ -0,0 +1,8 @@ +class CreateTeams < ActiveRecord::Migration + def change + create_table :teams do |t| + + t.timestamps + end + end +end diff --git a/db/migrate/20140424013231_create_alerts.rb b/db/migrate/20140424013231_create_alerts.rb new file mode 100644 index 0000000..68a8e10 --- /dev/null +++ b/db/migrate/20140424013231_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/20140424013232_create_pms.rb b/db/migrate/20140424013232_create_pms.rb new file mode 100644 index 0000000..93bb5c6 --- /dev/null +++ b/db/migrate/20140424013232_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/20140424013233_create_tournaments.rb b/db/migrate/20140424013233_create_tournaments.rb new file mode 100644 index 0000000..716871f --- /dev/null +++ b/db/migrate/20140424013233_create_tournaments.rb @@ -0,0 +1,19 @@ +class CreateTournaments < ActiveRecord::Migration + def change + create_table :tournaments do |t| + t.references :game, index: true + t.integer :status + t.string :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.string :sampling_method + + t.timestamps + end + add_index :tournaments, :name, unique: true + end +end diff --git a/db/migrate/20140424013234_create_games.rb b/db/migrate/20140424013234_create_games.rb new file mode 100644 index 0000000..46ed30d --- /dev/null +++ b/db/migrate/20140424013234_create_games.rb @@ -0,0 +1,17 @@ +class CreateGames < ActiveRecord::Migration + def change + create_table :games do |t| + t.string :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.string :sampling_method + + t.timestamps + end + add_index :games, :name, unique: true + end +end diff --git a/db/migrate/20140424013236_create_users.rb b/db/migrate/20140424013236_create_users.rb new file mode 100644 index 0000000..8032870 --- /dev/null +++ b/db/migrate/20140424013236_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/20140424013237_create_sessions.rb b/db/migrate/20140424013237_create_sessions.rb new file mode 100644 index 0000000..f667f1e --- /dev/null +++ b/db/migrate/20140424013237_create_sessions.rb @@ -0,0 +1,11 @@ +class CreateSessions < ActiveRecord::Migration + def change + create_table :sessions do |t| + t.references :user, index: true + t.string :token + + t.timestamps + end + add_index :sessions, :token, unique: true + end +end diff --git a/db/migrate/20140424013239_create_brackets.rb b/db/migrate/20140424013239_create_brackets.rb new file mode 100644 index 0000000..8813bf2 --- /dev/null +++ b/db/migrate/20140424013239_create_brackets.rb @@ -0,0 +1,11 @@ +class CreateBrackets < ActiveRecord::Migration + def change + create_table :brackets do |t| + t.references :user, index: true + t.references :tournament, index: true + t.string :name + + t.timestamps + end + end +end diff --git a/db/migrate/20140424013241_create_game_settings.rb b/db/migrate/20140424013241_create_game_settings.rb new file mode 100644 index 0000000..502b4fe --- /dev/null +++ b/db/migrate/20140424013241_create_game_settings.rb @@ -0,0 +1,16 @@ +class CreateGameSettings < ActiveRecord::Migration + def change + create_table :game_settings do |t| + t.references :game, index: true + t.string :name + t.integer :vartype + t.text :type_opt + t.text :description + t.integer :display_order + t.text :default + t.references :parent, index: true + + t.timestamps + end + end +end diff --git a/db/migrate/20140424013242_create_tournament_settings.rb b/db/migrate/20140424013242_create_tournament_settings.rb new file mode 100644 index 0000000..e56697f --- /dev/null +++ b/db/migrate/20140424013242_create_tournament_settings.rb @@ -0,0 +1,15 @@ +class CreateTournamentSettings < ActiveRecord::Migration + def change + create_table :tournament_settings do |t| + t.references :tournament, index: true + t.string :name + t.integer :vartype + t.text :type_opt + t.text :description + t.integer :display_order + t.text :value + + t.timestamps + end + end +end diff --git a/db/migrate/20140424013244_create_tournament_stages.rb b/db/migrate/20140424013244_create_tournament_stages.rb new file mode 100644 index 0000000..e3668cb --- /dev/null +++ b/db/migrate/20140424013244_create_tournament_stages.rb @@ -0,0 +1,11 @@ +class CreateTournamentStages < ActiveRecord::Migration + def change + create_table :tournament_stages do |t| + t.references :tournament, index: true + t.string :scheduling + t.text :structure + + t.timestamps + end + end +end diff --git a/db/migrate/20140424013245_create_statistics.rb b/db/migrate/20140424013245_create_statistics.rb new file mode 100644 index 0000000..cc2e97d --- /dev/null +++ b/db/migrate/20140424013245_create_statistics.rb @@ -0,0 +1,12 @@ +class CreateStatistics < ActiveRecord::Migration + def change + create_table :statistics do |t| + t.references :user, index: true + t.references :match, index: true + t.string :name + t.integer :value + + t.timestamps + end + end +end diff --git a/db/migrate/20140424013247_create_remote_usernames.rb b/db/migrate/20140424013247_create_remote_usernames.rb new file mode 100644 index 0000000..e265985 --- /dev/null +++ b/db/migrate/20140424013247_create_remote_usernames.rb @@ -0,0 +1,11 @@ +class CreateRemoteUsernames < ActiveRecord::Migration + def change + create_table :remote_usernames do |t| + t.references :game, index: true + t.references :user, index: true + t.text :json_value + + t.timestamps + end + end +end diff --git a/db/migrate/20140424013248_create_bracket_matches.rb b/db/migrate/20140424013248_create_bracket_matches.rb new file mode 100644 index 0000000..3323e31 --- /dev/null +++ b/db/migrate/20140424013248_create_bracket_matches.rb @@ -0,0 +1,11 @@ +class CreateBracketMatches < ActiveRecord::Migration + def change + create_table :bracket_matches do |t| + t.references :bracket, index: true + t.references :match, index: true + t.references :predicted_winner, index: true + + t.timestamps + end + end +end diff --git a/db/migrate/20140424013250_create_api_requests.rb b/db/migrate/20140424013250_create_api_requests.rb new file mode 100644 index 0000000..544c330 --- /dev/null +++ b/db/migrate/20140424013250_create_api_requests.rb @@ -0,0 +1,9 @@ +class CreateApiRequests < ActiveRecord::Migration + def change + create_table :api_requests do |t| + t.string :api_name + + t.timestamps + end + end +end diff --git a/db/migrate/20140424013251_create_tournament_players_join_table.rb b/db/migrate/20140424013251_create_tournament_players_join_table.rb new file mode 100644 index 0000000..be240e8 --- /dev/null +++ b/db/migrate/20140424013251_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/20140424013253_create_tournament_hosts_join_table.rb b/db/migrate/20140424013253_create_tournament_hosts_join_table.rb new file mode 100644 index 0000000..7521d89 --- /dev/null +++ b/db/migrate/20140424013253_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/20140424013254_create_team_user_join_table.rb b/db/migrate/20140424013254_create_team_user_join_table.rb new file mode 100644 index 0000000..f3b57fc --- /dev/null +++ b/db/migrate/20140424013254_create_team_user_join_table.rb @@ -0,0 +1,8 @@ +class CreateTeamUserJoinTable < ActiveRecord::Migration + def change + create_join_table :teams, :users do |t| + # t.index [:team_id, :user_id] + # t.index [:user_id, :team_id] + end + end +end diff --git a/db/migrate/20140424013256_create_match_team_join_table.rb b/db/migrate/20140424013256_create_match_team_join_table.rb new file mode 100644 index 0000000..c2ed1b7 --- /dev/null +++ b/db/migrate/20140424013256_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/20140424013300_add_hidden_attrs_to_user.rb b/db/migrate/20140424013300_add_hidden_attrs_to_user.rb new file mode 100644 index 0000000..9b5c505 --- /dev/null +++ b/db/migrate/20140424013300_add_hidden_attrs_to_user.rb @@ -0,0 +1,6 @@ +class AddHiddenAttrsToUser < ActiveRecord::Migration + def change + add_column :users, :password_digest, :string + add_column :users, :permissions, :integer + end +end diff --git a/db/schema.rb b/db/schema.rb index c014e84..efe99b5 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: 20140424005552) do +ActiveRecord::Schema.define(version: 20140424013300) do create_table "alerts", force: true do |t| t.integer "author_id" @@ -81,11 +81,13 @@ ActiveRecord::Schema.define(version: 20140424005552) do t.text "description" t.integer "display_order" t.text "default" + t.integer "parent_id" t.datetime "created_at" t.datetime "updated_at" end add_index "game_settings", ["game_id"], name: "index_game_settings_on_game_id" + add_index "game_settings", ["parent_id"], name: "index_game_settings_on_parent_id" create_table "games", force: true do |t| t.string "name" -- cgit v1.2.3-2-g168b From cfa41fcc58acc9ae50b84eb51e3d9fa9ecb3b79e Mon Sep 17 00:00:00 2001 From: DavisLWebb Date: Wed, 23 Apr 2014 21:45:40 -0400 Subject: run ./generate.sh --- .../20140423213222_create_simple_captcha_data.rb | 15 ------ .../20140423214420_create_simple_captcha_data.rb | 15 ++++++ ...0424013221_create_mailboxer.mailboxer_engine.rb | 62 ---------------------- ...4013222_add_notified_object.mailboxer_engine.rb | 18 ------- ...13223_add_notification_code.mailboxer_engine.rb | 14 ----- ...40424013224_add_attachments.mailboxer_engine.rb | 10 ---- ...013225_rename_receipts_read.mailboxer_engine.rb | 10 ---- ...global_notification_support.mailboxer_engine.rb | 10 ---- db/migrate/20140424013227_create_delayed_jobs.rb | 22 -------- db/migrate/20140424013228_create_servers.rb | 9 ---- db/migrate/20140424013229_create_matches.rb | 13 ----- db/migrate/20140424013230_create_teams.rb | 8 --- db/migrate/20140424013231_create_alerts.rb | 10 ---- db/migrate/20140424013232_create_pms.rb | 11 ---- db/migrate/20140424013233_create_tournaments.rb | 19 ------- db/migrate/20140424013234_create_games.rb | 17 ------ db/migrate/20140424013236_create_users.rb | 13 ----- db/migrate/20140424013237_create_sessions.rb | 11 ---- db/migrate/20140424013239_create_brackets.rb | 11 ---- db/migrate/20140424013241_create_game_settings.rb | 16 ------ .../20140424013242_create_tournament_settings.rb | 15 ------ .../20140424013244_create_tournament_stages.rb | 11 ---- db/migrate/20140424013245_create_statistics.rb | 12 ----- .../20140424013247_create_remote_usernames.rb | 11 ---- .../20140424013248_create_bracket_matches.rb | 11 ---- db/migrate/20140424013250_create_api_requests.rb | 9 ---- ...4013251_create_tournament_players_join_table.rb | 8 --- ...424013253_create_tournament_hosts_join_table.rb | 8 --- .../20140424013254_create_team_user_join_table.rb | 8 --- .../20140424013256_create_match_team_join_table.rb | 8 --- .../20140424013300_add_hidden_attrs_to_user.rb | 6 --- ...0424014418_create_mailboxer.mailboxer_engine.rb | 62 ++++++++++++++++++++++ ...4014419_add_notified_object.mailboxer_engine.rb | 18 +++++++ ...14420_add_notification_code.mailboxer_engine.rb | 14 +++++ ...40424014421_add_attachments.mailboxer_engine.rb | 10 ++++ ...014422_rename_receipts_read.mailboxer_engine.rb | 10 ++++ ...global_notification_support.mailboxer_engine.rb | 10 ++++ db/migrate/20140424014424_create_delayed_jobs.rb | 22 ++++++++ db/migrate/20140424014425_create_servers.rb | 9 ++++ db/migrate/20140424014426_create_matches.rb | 13 +++++ db/migrate/20140424014427_create_teams.rb | 8 +++ db/migrate/20140424014428_create_alerts.rb | 10 ++++ db/migrate/20140424014429_create_pms.rb | 11 ++++ db/migrate/20140424014431_create_tournaments.rb | 19 +++++++ db/migrate/20140424014433_create_games.rb | 18 +++++++ db/migrate/20140424014434_create_users.rb | 13 +++++ db/migrate/20140424014436_create_sessions.rb | 11 ++++ db/migrate/20140424014437_create_brackets.rb | 11 ++++ db/migrate/20140424014439_create_game_settings.rb | 15 ++++++ .../20140424014440_create_tournament_settings.rb | 15 ++++++ .../20140424014442_create_tournament_stages.rb | 11 ++++ db/migrate/20140424014443_create_statistics.rb | 12 +++++ .../20140424014445_create_remote_usernames.rb | 11 ++++ .../20140424014446_create_bracket_matches.rb | 11 ++++ db/migrate/20140424014448_create_api_requests.rb | 9 ++++ ...4014449_create_tournament_players_join_table.rb | 8 +++ ...424014451_create_tournament_hosts_join_table.rb | 8 +++ .../20140424014452_create_team_user_join_table.rb | 8 +++ .../20140424014454_create_match_team_join_table.rb | 8 +++ .../20140424014459_add_hidden_attrs_to_user.rb | 6 +++ db/schema.rb | 6 +-- 61 files changed, 409 insertions(+), 409 deletions(-) delete mode 100644 db/migrate/20140423213222_create_simple_captcha_data.rb create mode 100644 db/migrate/20140423214420_create_simple_captcha_data.rb delete mode 100644 db/migrate/20140424013221_create_mailboxer.mailboxer_engine.rb delete mode 100644 db/migrate/20140424013222_add_notified_object.mailboxer_engine.rb delete mode 100644 db/migrate/20140424013223_add_notification_code.mailboxer_engine.rb delete mode 100644 db/migrate/20140424013224_add_attachments.mailboxer_engine.rb delete mode 100644 db/migrate/20140424013225_rename_receipts_read.mailboxer_engine.rb delete mode 100644 db/migrate/20140424013226_add_global_notification_support.mailboxer_engine.rb delete mode 100644 db/migrate/20140424013227_create_delayed_jobs.rb delete mode 100644 db/migrate/20140424013228_create_servers.rb delete mode 100644 db/migrate/20140424013229_create_matches.rb delete mode 100644 db/migrate/20140424013230_create_teams.rb delete mode 100644 db/migrate/20140424013231_create_alerts.rb delete mode 100644 db/migrate/20140424013232_create_pms.rb delete mode 100644 db/migrate/20140424013233_create_tournaments.rb delete mode 100644 db/migrate/20140424013234_create_games.rb delete mode 100644 db/migrate/20140424013236_create_users.rb delete mode 100644 db/migrate/20140424013237_create_sessions.rb delete mode 100644 db/migrate/20140424013239_create_brackets.rb delete mode 100644 db/migrate/20140424013241_create_game_settings.rb delete mode 100644 db/migrate/20140424013242_create_tournament_settings.rb delete mode 100644 db/migrate/20140424013244_create_tournament_stages.rb delete mode 100644 db/migrate/20140424013245_create_statistics.rb delete mode 100644 db/migrate/20140424013247_create_remote_usernames.rb delete mode 100644 db/migrate/20140424013248_create_bracket_matches.rb delete mode 100644 db/migrate/20140424013250_create_api_requests.rb delete mode 100644 db/migrate/20140424013251_create_tournament_players_join_table.rb delete mode 100644 db/migrate/20140424013253_create_tournament_hosts_join_table.rb delete mode 100644 db/migrate/20140424013254_create_team_user_join_table.rb delete mode 100644 db/migrate/20140424013256_create_match_team_join_table.rb delete mode 100644 db/migrate/20140424013300_add_hidden_attrs_to_user.rb create mode 100644 db/migrate/20140424014418_create_mailboxer.mailboxer_engine.rb create mode 100644 db/migrate/20140424014419_add_notified_object.mailboxer_engine.rb create mode 100644 db/migrate/20140424014420_add_notification_code.mailboxer_engine.rb create mode 100644 db/migrate/20140424014421_add_attachments.mailboxer_engine.rb create mode 100644 db/migrate/20140424014422_rename_receipts_read.mailboxer_engine.rb create mode 100644 db/migrate/20140424014423_add_global_notification_support.mailboxer_engine.rb create mode 100644 db/migrate/20140424014424_create_delayed_jobs.rb create mode 100644 db/migrate/20140424014425_create_servers.rb create mode 100644 db/migrate/20140424014426_create_matches.rb create mode 100644 db/migrate/20140424014427_create_teams.rb create mode 100644 db/migrate/20140424014428_create_alerts.rb create mode 100644 db/migrate/20140424014429_create_pms.rb create mode 100644 db/migrate/20140424014431_create_tournaments.rb create mode 100644 db/migrate/20140424014433_create_games.rb create mode 100644 db/migrate/20140424014434_create_users.rb create mode 100644 db/migrate/20140424014436_create_sessions.rb create mode 100644 db/migrate/20140424014437_create_brackets.rb create mode 100644 db/migrate/20140424014439_create_game_settings.rb create mode 100644 db/migrate/20140424014440_create_tournament_settings.rb create mode 100644 db/migrate/20140424014442_create_tournament_stages.rb create mode 100644 db/migrate/20140424014443_create_statistics.rb create mode 100644 db/migrate/20140424014445_create_remote_usernames.rb create mode 100644 db/migrate/20140424014446_create_bracket_matches.rb create mode 100644 db/migrate/20140424014448_create_api_requests.rb create mode 100644 db/migrate/20140424014449_create_tournament_players_join_table.rb create mode 100644 db/migrate/20140424014451_create_tournament_hosts_join_table.rb create mode 100644 db/migrate/20140424014452_create_team_user_join_table.rb create mode 100644 db/migrate/20140424014454_create_match_team_join_table.rb create mode 100644 db/migrate/20140424014459_add_hidden_attrs_to_user.rb (limited to 'db') diff --git a/db/migrate/20140423213222_create_simple_captcha_data.rb b/db/migrate/20140423213222_create_simple_captcha_data.rb deleted file mode 100644 index 4573b20..0000000 --- a/db/migrate/20140423213222_create_simple_captcha_data.rb +++ /dev/null @@ -1,15 +0,0 @@ -class CreateSimpleCaptchaData < ActiveRecord::Migration - def self.up - create_table :simple_captcha_data do |t| - t.string :key, :limit => 40 - t.string :value, :limit => 6 - t.timestamps - end - - add_index :simple_captcha_data, :key, :name => "idx_key" - end - - def self.down - drop_table :simple_captcha_data - end -end diff --git a/db/migrate/20140423214420_create_simple_captcha_data.rb b/db/migrate/20140423214420_create_simple_captcha_data.rb new file mode 100644 index 0000000..4573b20 --- /dev/null +++ b/db/migrate/20140423214420_create_simple_captcha_data.rb @@ -0,0 +1,15 @@ +class CreateSimpleCaptchaData < ActiveRecord::Migration + def self.up + create_table :simple_captcha_data do |t| + t.string :key, :limit => 40 + t.string :value, :limit => 6 + t.timestamps + end + + add_index :simple_captcha_data, :key, :name => "idx_key" + end + + def self.down + drop_table :simple_captcha_data + end +end diff --git a/db/migrate/20140424013221_create_mailboxer.mailboxer_engine.rb b/db/migrate/20140424013221_create_mailboxer.mailboxer_engine.rb deleted file mode 100644 index 690cec2..0000000 --- a/db/migrate/20140424013221_create_mailboxer.mailboxer_engine.rb +++ /dev/null @@ -1,62 +0,0 @@ -# This migration comes from mailboxer_engine (originally 20110511145103) -class CreateMailboxer < ActiveRecord::Migration - def self.up - #Tables - #Conversations - create_table :conversations do |t| - t.column :subject, :string, :default => "" - t.column :created_at, :datetime, :null => false - t.column :updated_at, :datetime, :null => false - end - #Receipts - create_table :receipts do |t| - t.references :receiver, :polymorphic => true - t.column :notification_id, :integer, :null => false - t.column :read, :boolean, :default => false - t.column :trashed, :boolean, :default => false - t.column :deleted, :boolean, :default => false - t.column :mailbox_type, :string, :limit => 25 - t.column :created_at, :datetime, :null => false - t.column :updated_at, :datetime, :null => false - end - #Notifications and Messages - create_table :notifications do |t| - t.column :type, :string - t.column :body, :text - t.column :subject, :string, :default => "" - t.references :sender, :polymorphic => true - t.references :object, :polymorphic => true - t.column :conversation_id, :integer - t.column :draft, :boolean, :default => false - t.column :updated_at, :datetime, :null => false - t.column :created_at, :datetime, :null => false - end - - - #Indexes - #Conversations - #Receipts - add_index "receipts","notification_id" - - #Messages - add_index "notifications","conversation_id" - - #Foreign keys - #Conversations - #Receipts - add_foreign_key "receipts", "notifications", :name => "receipts_on_notification_id" - #Messages - add_foreign_key "notifications", "conversations", :name => "notifications_on_conversation_id" - end - - def self.down - #Tables - remove_foreign_key "receipts", :name => "receipts_on_notification_id" - remove_foreign_key "notifications", :name => "notifications_on_conversation_id" - - #Indexes - drop_table :receipts - drop_table :conversations - drop_table :notifications - end -end diff --git a/db/migrate/20140424013222_add_notified_object.mailboxer_engine.rb b/db/migrate/20140424013222_add_notified_object.mailboxer_engine.rb deleted file mode 100644 index 7f41ac6..0000000 --- a/db/migrate/20140424013222_add_notified_object.mailboxer_engine.rb +++ /dev/null @@ -1,18 +0,0 @@ -# This migration comes from mailboxer_engine (originally 20110719110700) -class AddNotifiedObject < ActiveRecord::Migration - def self.up - change_table :notifications do |t| - t.references :notified_object, :polymorphic => true - t.remove :object_id - t.remove :object_type - end - end - - def self.down - change_table :notifications do |t| - t.remove :notified_object_id - t.remove :notified_object_type - t.references :object, :polymorphic => true - end - end -end diff --git a/db/migrate/20140424013223_add_notification_code.mailboxer_engine.rb b/db/migrate/20140424013223_add_notification_code.mailboxer_engine.rb deleted file mode 100644 index 04c12ef..0000000 --- a/db/migrate/20140424013223_add_notification_code.mailboxer_engine.rb +++ /dev/null @@ -1,14 +0,0 @@ -# This migration comes from mailboxer_engine (originally 20110912163911) -class AddNotificationCode < ActiveRecord::Migration - def self.up - change_table :notifications do |t| - t.string :notification_code, :default => nil - end - end - - def self.down - change_table :notifications do |t| - t.remove :notification_code - end - end -end \ No newline at end of file diff --git a/db/migrate/20140424013224_add_attachments.mailboxer_engine.rb b/db/migrate/20140424013224_add_attachments.mailboxer_engine.rb deleted file mode 100644 index b8d6588..0000000 --- a/db/migrate/20140424013224_add_attachments.mailboxer_engine.rb +++ /dev/null @@ -1,10 +0,0 @@ -# This migration comes from mailboxer_engine (originally 20111204163911) -class AddAttachments < ActiveRecord::Migration - def self.up - add_column :notifications, :attachment, :string - end - - def self.down - remove_column :notifications, :attachment - end -end diff --git a/db/migrate/20140424013225_rename_receipts_read.mailboxer_engine.rb b/db/migrate/20140424013225_rename_receipts_read.mailboxer_engine.rb deleted file mode 100644 index 9ce904f..0000000 --- a/db/migrate/20140424013225_rename_receipts_read.mailboxer_engine.rb +++ /dev/null @@ -1,10 +0,0 @@ -# This migration comes from mailboxer_engine (originally 20120813110712) -class RenameReceiptsRead < ActiveRecord::Migration - def up - rename_column :receipts, :read, :is_read - end - - def down - rename_column :receipts, :is_read, :read - end -end diff --git a/db/migrate/20140424013226_add_global_notification_support.mailboxer_engine.rb b/db/migrate/20140424013226_add_global_notification_support.mailboxer_engine.rb deleted file mode 100644 index 60f67ab..0000000 --- a/db/migrate/20140424013226_add_global_notification_support.mailboxer_engine.rb +++ /dev/null @@ -1,10 +0,0 @@ -# This migration comes from mailboxer_engine (originally 20130305144212) -class AddGlobalNotificationSupport < ActiveRecord::Migration - - def change - change_table :notifications do |t| - t.boolean :global, default: false - t.datetime :expires - end - end -end diff --git a/db/migrate/20140424013227_create_delayed_jobs.rb b/db/migrate/20140424013227_create_delayed_jobs.rb deleted file mode 100644 index ec0dd93..0000000 --- a/db/migrate/20140424013227_create_delayed_jobs.rb +++ /dev/null @@ -1,22 +0,0 @@ -class CreateDelayedJobs < ActiveRecord::Migration - def self.up - create_table :delayed_jobs, :force => true do |table| - table.integer :priority, :default => 0, :null => false # Allows some jobs to jump to the front of the queue - table.integer :attempts, :default => 0, :null => false # Provides for retries, but still fail eventually. - table.text :handler, :null => false # YAML-encoded string of the object that will do work - table.text :last_error # reason for last failure (See Note below) - table.datetime :run_at # When to run. Could be Time.zone.now for immediately, or sometime in the future. - table.datetime :locked_at # Set when a client is working on this object - table.datetime :failed_at # Set when all retries have failed (actually, by default, the record is deleted instead) - table.string :locked_by # Who is working on this object (if locked) - table.string :queue # The name of the queue this job is in - table.timestamps - end - - add_index :delayed_jobs, [:priority, :run_at], :name => 'delayed_jobs_priority' - end - - def self.down - drop_table :delayed_jobs - end -end diff --git a/db/migrate/20140424013228_create_servers.rb b/db/migrate/20140424013228_create_servers.rb deleted file mode 100644 index fbe1b02..0000000 --- a/db/migrate/20140424013228_create_servers.rb +++ /dev/null @@ -1,9 +0,0 @@ -class CreateServers < ActiveRecord::Migration - def change - create_table :servers do |t| - t.integer :default_user_permissions - - t.timestamps - end - end -end diff --git a/db/migrate/20140424013229_create_matches.rb b/db/migrate/20140424013229_create_matches.rb deleted file mode 100644 index bac92d1..0000000 --- a/db/migrate/20140424013229_create_matches.rb +++ /dev/null @@ -1,13 +0,0 @@ -class CreateMatches < ActiveRecord::Migration - def change - create_table :matches do |t| - t.integer :status - t.references :tournament_stage, index: true - t.references :winner, index: true - t.text :remote_id - t.integer :submitted_peer_evaluations - - t.timestamps - end - end -end diff --git a/db/migrate/20140424013230_create_teams.rb b/db/migrate/20140424013230_create_teams.rb deleted file mode 100644 index dd8397d..0000000 --- a/db/migrate/20140424013230_create_teams.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateTeams < ActiveRecord::Migration - def change - create_table :teams do |t| - - t.timestamps - end - end -end diff --git a/db/migrate/20140424013231_create_alerts.rb b/db/migrate/20140424013231_create_alerts.rb deleted file mode 100644 index 68a8e10..0000000 --- a/db/migrate/20140424013231_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/20140424013232_create_pms.rb b/db/migrate/20140424013232_create_pms.rb deleted file mode 100644 index 93bb5c6..0000000 --- a/db/migrate/20140424013232_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/20140424013233_create_tournaments.rb b/db/migrate/20140424013233_create_tournaments.rb deleted file mode 100644 index 716871f..0000000 --- a/db/migrate/20140424013233_create_tournaments.rb +++ /dev/null @@ -1,19 +0,0 @@ -class CreateTournaments < ActiveRecord::Migration - def change - create_table :tournaments do |t| - t.references :game, index: true - t.integer :status - t.string :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.string :sampling_method - - t.timestamps - end - add_index :tournaments, :name, unique: true - end -end diff --git a/db/migrate/20140424013234_create_games.rb b/db/migrate/20140424013234_create_games.rb deleted file mode 100644 index 46ed30d..0000000 --- a/db/migrate/20140424013234_create_games.rb +++ /dev/null @@ -1,17 +0,0 @@ -class CreateGames < ActiveRecord::Migration - def change - create_table :games do |t| - t.string :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.string :sampling_method - - t.timestamps - end - add_index :games, :name, unique: true - end -end diff --git a/db/migrate/20140424013236_create_users.rb b/db/migrate/20140424013236_create_users.rb deleted file mode 100644 index 8032870..0000000 --- a/db/migrate/20140424013236_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/20140424013237_create_sessions.rb b/db/migrate/20140424013237_create_sessions.rb deleted file mode 100644 index f667f1e..0000000 --- a/db/migrate/20140424013237_create_sessions.rb +++ /dev/null @@ -1,11 +0,0 @@ -class CreateSessions < ActiveRecord::Migration - def change - create_table :sessions do |t| - t.references :user, index: true - t.string :token - - t.timestamps - end - add_index :sessions, :token, unique: true - end -end diff --git a/db/migrate/20140424013239_create_brackets.rb b/db/migrate/20140424013239_create_brackets.rb deleted file mode 100644 index 8813bf2..0000000 --- a/db/migrate/20140424013239_create_brackets.rb +++ /dev/null @@ -1,11 +0,0 @@ -class CreateBrackets < ActiveRecord::Migration - def change - create_table :brackets do |t| - t.references :user, index: true - t.references :tournament, index: true - t.string :name - - t.timestamps - end - end -end diff --git a/db/migrate/20140424013241_create_game_settings.rb b/db/migrate/20140424013241_create_game_settings.rb deleted file mode 100644 index 502b4fe..0000000 --- a/db/migrate/20140424013241_create_game_settings.rb +++ /dev/null @@ -1,16 +0,0 @@ -class CreateGameSettings < ActiveRecord::Migration - def change - create_table :game_settings do |t| - t.references :game, index: true - t.string :name - t.integer :vartype - t.text :type_opt - t.text :description - t.integer :display_order - t.text :default - t.references :parent, index: true - - t.timestamps - end - end -end diff --git a/db/migrate/20140424013242_create_tournament_settings.rb b/db/migrate/20140424013242_create_tournament_settings.rb deleted file mode 100644 index e56697f..0000000 --- a/db/migrate/20140424013242_create_tournament_settings.rb +++ /dev/null @@ -1,15 +0,0 @@ -class CreateTournamentSettings < ActiveRecord::Migration - def change - create_table :tournament_settings do |t| - t.references :tournament, index: true - t.string :name - t.integer :vartype - t.text :type_opt - t.text :description - t.integer :display_order - t.text :value - - t.timestamps - end - end -end diff --git a/db/migrate/20140424013244_create_tournament_stages.rb b/db/migrate/20140424013244_create_tournament_stages.rb deleted file mode 100644 index e3668cb..0000000 --- a/db/migrate/20140424013244_create_tournament_stages.rb +++ /dev/null @@ -1,11 +0,0 @@ -class CreateTournamentStages < ActiveRecord::Migration - def change - create_table :tournament_stages do |t| - t.references :tournament, index: true - t.string :scheduling - t.text :structure - - t.timestamps - end - end -end diff --git a/db/migrate/20140424013245_create_statistics.rb b/db/migrate/20140424013245_create_statistics.rb deleted file mode 100644 index cc2e97d..0000000 --- a/db/migrate/20140424013245_create_statistics.rb +++ /dev/null @@ -1,12 +0,0 @@ -class CreateStatistics < ActiveRecord::Migration - def change - create_table :statistics do |t| - t.references :user, index: true - t.references :match, index: true - t.string :name - t.integer :value - - t.timestamps - end - end -end diff --git a/db/migrate/20140424013247_create_remote_usernames.rb b/db/migrate/20140424013247_create_remote_usernames.rb deleted file mode 100644 index e265985..0000000 --- a/db/migrate/20140424013247_create_remote_usernames.rb +++ /dev/null @@ -1,11 +0,0 @@ -class CreateRemoteUsernames < ActiveRecord::Migration - def change - create_table :remote_usernames do |t| - t.references :game, index: true - t.references :user, index: true - t.text :json_value - - t.timestamps - end - end -end diff --git a/db/migrate/20140424013248_create_bracket_matches.rb b/db/migrate/20140424013248_create_bracket_matches.rb deleted file mode 100644 index 3323e31..0000000 --- a/db/migrate/20140424013248_create_bracket_matches.rb +++ /dev/null @@ -1,11 +0,0 @@ -class CreateBracketMatches < ActiveRecord::Migration - def change - create_table :bracket_matches do |t| - t.references :bracket, index: true - t.references :match, index: true - t.references :predicted_winner, index: true - - t.timestamps - end - end -end diff --git a/db/migrate/20140424013250_create_api_requests.rb b/db/migrate/20140424013250_create_api_requests.rb deleted file mode 100644 index 544c330..0000000 --- a/db/migrate/20140424013250_create_api_requests.rb +++ /dev/null @@ -1,9 +0,0 @@ -class CreateApiRequests < ActiveRecord::Migration - def change - create_table :api_requests do |t| - t.string :api_name - - t.timestamps - end - end -end diff --git a/db/migrate/20140424013251_create_tournament_players_join_table.rb b/db/migrate/20140424013251_create_tournament_players_join_table.rb deleted file mode 100644 index be240e8..0000000 --- a/db/migrate/20140424013251_create_tournament_players_join_table.rb +++ /dev/null @@ -1,8 +0,0 @@ -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/20140424013253_create_tournament_hosts_join_table.rb b/db/migrate/20140424013253_create_tournament_hosts_join_table.rb deleted file mode 100644 index 7521d89..0000000 --- a/db/migrate/20140424013253_create_tournament_hosts_join_table.rb +++ /dev/null @@ -1,8 +0,0 @@ -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/20140424013254_create_team_user_join_table.rb b/db/migrate/20140424013254_create_team_user_join_table.rb deleted file mode 100644 index f3b57fc..0000000 --- a/db/migrate/20140424013254_create_team_user_join_table.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateTeamUserJoinTable < ActiveRecord::Migration - def change - create_join_table :teams, :users do |t| - # t.index [:team_id, :user_id] - # t.index [:user_id, :team_id] - end - end -end diff --git a/db/migrate/20140424013256_create_match_team_join_table.rb b/db/migrate/20140424013256_create_match_team_join_table.rb deleted file mode 100644 index c2ed1b7..0000000 --- a/db/migrate/20140424013256_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/20140424013300_add_hidden_attrs_to_user.rb b/db/migrate/20140424013300_add_hidden_attrs_to_user.rb deleted file mode 100644 index 9b5c505..0000000 --- a/db/migrate/20140424013300_add_hidden_attrs_to_user.rb +++ /dev/null @@ -1,6 +0,0 @@ -class AddHiddenAttrsToUser < ActiveRecord::Migration - def change - add_column :users, :password_digest, :string - add_column :users, :permissions, :integer - end -end diff --git a/db/migrate/20140424014418_create_mailboxer.mailboxer_engine.rb b/db/migrate/20140424014418_create_mailboxer.mailboxer_engine.rb new file mode 100644 index 0000000..690cec2 --- /dev/null +++ b/db/migrate/20140424014418_create_mailboxer.mailboxer_engine.rb @@ -0,0 +1,62 @@ +# This migration comes from mailboxer_engine (originally 20110511145103) +class CreateMailboxer < ActiveRecord::Migration + def self.up + #Tables + #Conversations + create_table :conversations do |t| + t.column :subject, :string, :default => "" + t.column :created_at, :datetime, :null => false + t.column :updated_at, :datetime, :null => false + end + #Receipts + create_table :receipts do |t| + t.references :receiver, :polymorphic => true + t.column :notification_id, :integer, :null => false + t.column :read, :boolean, :default => false + t.column :trashed, :boolean, :default => false + t.column :deleted, :boolean, :default => false + t.column :mailbox_type, :string, :limit => 25 + t.column :created_at, :datetime, :null => false + t.column :updated_at, :datetime, :null => false + end + #Notifications and Messages + create_table :notifications do |t| + t.column :type, :string + t.column :body, :text + t.column :subject, :string, :default => "" + t.references :sender, :polymorphic => true + t.references :object, :polymorphic => true + t.column :conversation_id, :integer + t.column :draft, :boolean, :default => false + t.column :updated_at, :datetime, :null => false + t.column :created_at, :datetime, :null => false + end + + + #Indexes + #Conversations + #Receipts + add_index "receipts","notification_id" + + #Messages + add_index "notifications","conversation_id" + + #Foreign keys + #Conversations + #Receipts + add_foreign_key "receipts", "notifications", :name => "receipts_on_notification_id" + #Messages + add_foreign_key "notifications", "conversations", :name => "notifications_on_conversation_id" + end + + def self.down + #Tables + remove_foreign_key "receipts", :name => "receipts_on_notification_id" + remove_foreign_key "notifications", :name => "notifications_on_conversation_id" + + #Indexes + drop_table :receipts + drop_table :conversations + drop_table :notifications + end +end diff --git a/db/migrate/20140424014419_add_notified_object.mailboxer_engine.rb b/db/migrate/20140424014419_add_notified_object.mailboxer_engine.rb new file mode 100644 index 0000000..7f41ac6 --- /dev/null +++ b/db/migrate/20140424014419_add_notified_object.mailboxer_engine.rb @@ -0,0 +1,18 @@ +# This migration comes from mailboxer_engine (originally 20110719110700) +class AddNotifiedObject < ActiveRecord::Migration + def self.up + change_table :notifications do |t| + t.references :notified_object, :polymorphic => true + t.remove :object_id + t.remove :object_type + end + end + + def self.down + change_table :notifications do |t| + t.remove :notified_object_id + t.remove :notified_object_type + t.references :object, :polymorphic => true + end + end +end diff --git a/db/migrate/20140424014420_add_notification_code.mailboxer_engine.rb b/db/migrate/20140424014420_add_notification_code.mailboxer_engine.rb new file mode 100644 index 0000000..04c12ef --- /dev/null +++ b/db/migrate/20140424014420_add_notification_code.mailboxer_engine.rb @@ -0,0 +1,14 @@ +# This migration comes from mailboxer_engine (originally 20110912163911) +class AddNotificationCode < ActiveRecord::Migration + def self.up + change_table :notifications do |t| + t.string :notification_code, :default => nil + end + end + + def self.down + change_table :notifications do |t| + t.remove :notification_code + end + end +end \ No newline at end of file diff --git a/db/migrate/20140424014421_add_attachments.mailboxer_engine.rb b/db/migrate/20140424014421_add_attachments.mailboxer_engine.rb new file mode 100644 index 0000000..b8d6588 --- /dev/null +++ b/db/migrate/20140424014421_add_attachments.mailboxer_engine.rb @@ -0,0 +1,10 @@ +# This migration comes from mailboxer_engine (originally 20111204163911) +class AddAttachments < ActiveRecord::Migration + def self.up + add_column :notifications, :attachment, :string + end + + def self.down + remove_column :notifications, :attachment + end +end diff --git a/db/migrate/20140424014422_rename_receipts_read.mailboxer_engine.rb b/db/migrate/20140424014422_rename_receipts_read.mailboxer_engine.rb new file mode 100644 index 0000000..9ce904f --- /dev/null +++ b/db/migrate/20140424014422_rename_receipts_read.mailboxer_engine.rb @@ -0,0 +1,10 @@ +# This migration comes from mailboxer_engine (originally 20120813110712) +class RenameReceiptsRead < ActiveRecord::Migration + def up + rename_column :receipts, :read, :is_read + end + + def down + rename_column :receipts, :is_read, :read + end +end diff --git a/db/migrate/20140424014423_add_global_notification_support.mailboxer_engine.rb b/db/migrate/20140424014423_add_global_notification_support.mailboxer_engine.rb new file mode 100644 index 0000000..60f67ab --- /dev/null +++ b/db/migrate/20140424014423_add_global_notification_support.mailboxer_engine.rb @@ -0,0 +1,10 @@ +# This migration comes from mailboxer_engine (originally 20130305144212) +class AddGlobalNotificationSupport < ActiveRecord::Migration + + def change + change_table :notifications do |t| + t.boolean :global, default: false + t.datetime :expires + end + end +end diff --git a/db/migrate/20140424014424_create_delayed_jobs.rb b/db/migrate/20140424014424_create_delayed_jobs.rb new file mode 100644 index 0000000..ec0dd93 --- /dev/null +++ b/db/migrate/20140424014424_create_delayed_jobs.rb @@ -0,0 +1,22 @@ +class CreateDelayedJobs < ActiveRecord::Migration + def self.up + create_table :delayed_jobs, :force => true do |table| + table.integer :priority, :default => 0, :null => false # Allows some jobs to jump to the front of the queue + table.integer :attempts, :default => 0, :null => false # Provides for retries, but still fail eventually. + table.text :handler, :null => false # YAML-encoded string of the object that will do work + table.text :last_error # reason for last failure (See Note below) + table.datetime :run_at # When to run. Could be Time.zone.now for immediately, or sometime in the future. + table.datetime :locked_at # Set when a client is working on this object + table.datetime :failed_at # Set when all retries have failed (actually, by default, the record is deleted instead) + table.string :locked_by # Who is working on this object (if locked) + table.string :queue # The name of the queue this job is in + table.timestamps + end + + add_index :delayed_jobs, [:priority, :run_at], :name => 'delayed_jobs_priority' + end + + def self.down + drop_table :delayed_jobs + end +end diff --git a/db/migrate/20140424014425_create_servers.rb b/db/migrate/20140424014425_create_servers.rb new file mode 100644 index 0000000..fbe1b02 --- /dev/null +++ b/db/migrate/20140424014425_create_servers.rb @@ -0,0 +1,9 @@ +class CreateServers < ActiveRecord::Migration + def change + create_table :servers do |t| + t.integer :default_user_permissions + + t.timestamps + end + end +end diff --git a/db/migrate/20140424014426_create_matches.rb b/db/migrate/20140424014426_create_matches.rb new file mode 100644 index 0000000..bac92d1 --- /dev/null +++ b/db/migrate/20140424014426_create_matches.rb @@ -0,0 +1,13 @@ +class CreateMatches < ActiveRecord::Migration + def change + create_table :matches do |t| + t.integer :status + t.references :tournament_stage, index: true + t.references :winner, index: true + t.text :remote_id + t.integer :submitted_peer_evaluations + + t.timestamps + end + end +end diff --git a/db/migrate/20140424014427_create_teams.rb b/db/migrate/20140424014427_create_teams.rb new file mode 100644 index 0000000..dd8397d --- /dev/null +++ b/db/migrate/20140424014427_create_teams.rb @@ -0,0 +1,8 @@ +class CreateTeams < ActiveRecord::Migration + def change + create_table :teams do |t| + + t.timestamps + end + end +end diff --git a/db/migrate/20140424014428_create_alerts.rb b/db/migrate/20140424014428_create_alerts.rb new file mode 100644 index 0000000..68a8e10 --- /dev/null +++ b/db/migrate/20140424014428_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/20140424014429_create_pms.rb b/db/migrate/20140424014429_create_pms.rb new file mode 100644 index 0000000..93bb5c6 --- /dev/null +++ b/db/migrate/20140424014429_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/20140424014431_create_tournaments.rb b/db/migrate/20140424014431_create_tournaments.rb new file mode 100644 index 0000000..716871f --- /dev/null +++ b/db/migrate/20140424014431_create_tournaments.rb @@ -0,0 +1,19 @@ +class CreateTournaments < ActiveRecord::Migration + def change + create_table :tournaments do |t| + t.references :game, index: true + t.integer :status + t.string :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.string :sampling_method + + t.timestamps + end + add_index :tournaments, :name, unique: true + end +end diff --git a/db/migrate/20140424014433_create_games.rb b/db/migrate/20140424014433_create_games.rb new file mode 100644 index 0000000..23edf0b --- /dev/null +++ b/db/migrate/20140424014433_create_games.rb @@ -0,0 +1,18 @@ +class CreateGames < ActiveRecord::Migration + def change + create_table :games do |t| + t.references :parent, index: true + t.string :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.string :sampling_method + + t.timestamps + end + add_index :games, :name, unique: true + end +end diff --git a/db/migrate/20140424014434_create_users.rb b/db/migrate/20140424014434_create_users.rb new file mode 100644 index 0000000..8032870 --- /dev/null +++ b/db/migrate/20140424014434_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/20140424014436_create_sessions.rb b/db/migrate/20140424014436_create_sessions.rb new file mode 100644 index 0000000..f667f1e --- /dev/null +++ b/db/migrate/20140424014436_create_sessions.rb @@ -0,0 +1,11 @@ +class CreateSessions < ActiveRecord::Migration + def change + create_table :sessions do |t| + t.references :user, index: true + t.string :token + + t.timestamps + end + add_index :sessions, :token, unique: true + end +end diff --git a/db/migrate/20140424014437_create_brackets.rb b/db/migrate/20140424014437_create_brackets.rb new file mode 100644 index 0000000..8813bf2 --- /dev/null +++ b/db/migrate/20140424014437_create_brackets.rb @@ -0,0 +1,11 @@ +class CreateBrackets < ActiveRecord::Migration + def change + create_table :brackets do |t| + t.references :user, index: true + t.references :tournament, index: true + t.string :name + + t.timestamps + end + end +end diff --git a/db/migrate/20140424014439_create_game_settings.rb b/db/migrate/20140424014439_create_game_settings.rb new file mode 100644 index 0000000..06fb72e --- /dev/null +++ b/db/migrate/20140424014439_create_game_settings.rb @@ -0,0 +1,15 @@ +class CreateGameSettings < ActiveRecord::Migration + def change + create_table :game_settings do |t| + t.references :game, index: true + t.string :name + t.integer :vartype + t.text :type_opt + t.text :description + t.integer :display_order + t.text :default + + t.timestamps + end + end +end diff --git a/db/migrate/20140424014440_create_tournament_settings.rb b/db/migrate/20140424014440_create_tournament_settings.rb new file mode 100644 index 0000000..e56697f --- /dev/null +++ b/db/migrate/20140424014440_create_tournament_settings.rb @@ -0,0 +1,15 @@ +class CreateTournamentSettings < ActiveRecord::Migration + def change + create_table :tournament_settings do |t| + t.references :tournament, index: true + t.string :name + t.integer :vartype + t.text :type_opt + t.text :description + t.integer :display_order + t.text :value + + t.timestamps + end + end +end diff --git a/db/migrate/20140424014442_create_tournament_stages.rb b/db/migrate/20140424014442_create_tournament_stages.rb new file mode 100644 index 0000000..e3668cb --- /dev/null +++ b/db/migrate/20140424014442_create_tournament_stages.rb @@ -0,0 +1,11 @@ +class CreateTournamentStages < ActiveRecord::Migration + def change + create_table :tournament_stages do |t| + t.references :tournament, index: true + t.string :scheduling + t.text :structure + + t.timestamps + end + end +end diff --git a/db/migrate/20140424014443_create_statistics.rb b/db/migrate/20140424014443_create_statistics.rb new file mode 100644 index 0000000..cc2e97d --- /dev/null +++ b/db/migrate/20140424014443_create_statistics.rb @@ -0,0 +1,12 @@ +class CreateStatistics < ActiveRecord::Migration + def change + create_table :statistics do |t| + t.references :user, index: true + t.references :match, index: true + t.string :name + t.integer :value + + t.timestamps + end + end +end diff --git a/db/migrate/20140424014445_create_remote_usernames.rb b/db/migrate/20140424014445_create_remote_usernames.rb new file mode 100644 index 0000000..e265985 --- /dev/null +++ b/db/migrate/20140424014445_create_remote_usernames.rb @@ -0,0 +1,11 @@ +class CreateRemoteUsernames < ActiveRecord::Migration + def change + create_table :remote_usernames do |t| + t.references :game, index: true + t.references :user, index: true + t.text :json_value + + t.timestamps + end + end +end diff --git a/db/migrate/20140424014446_create_bracket_matches.rb b/db/migrate/20140424014446_create_bracket_matches.rb new file mode 100644 index 0000000..3323e31 --- /dev/null +++ b/db/migrate/20140424014446_create_bracket_matches.rb @@ -0,0 +1,11 @@ +class CreateBracketMatches < ActiveRecord::Migration + def change + create_table :bracket_matches do |t| + t.references :bracket, index: true + t.references :match, index: true + t.references :predicted_winner, index: true + + t.timestamps + end + end +end diff --git a/db/migrate/20140424014448_create_api_requests.rb b/db/migrate/20140424014448_create_api_requests.rb new file mode 100644 index 0000000..544c330 --- /dev/null +++ b/db/migrate/20140424014448_create_api_requests.rb @@ -0,0 +1,9 @@ +class CreateApiRequests < ActiveRecord::Migration + def change + create_table :api_requests do |t| + t.string :api_name + + t.timestamps + end + end +end diff --git a/db/migrate/20140424014449_create_tournament_players_join_table.rb b/db/migrate/20140424014449_create_tournament_players_join_table.rb new file mode 100644 index 0000000..be240e8 --- /dev/null +++ b/db/migrate/20140424014449_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/20140424014451_create_tournament_hosts_join_table.rb b/db/migrate/20140424014451_create_tournament_hosts_join_table.rb new file mode 100644 index 0000000..7521d89 --- /dev/null +++ b/db/migrate/20140424014451_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/20140424014452_create_team_user_join_table.rb b/db/migrate/20140424014452_create_team_user_join_table.rb new file mode 100644 index 0000000..f3b57fc --- /dev/null +++ b/db/migrate/20140424014452_create_team_user_join_table.rb @@ -0,0 +1,8 @@ +class CreateTeamUserJoinTable < ActiveRecord::Migration + def change + create_join_table :teams, :users do |t| + # t.index [:team_id, :user_id] + # t.index [:user_id, :team_id] + end + end +end diff --git a/db/migrate/20140424014454_create_match_team_join_table.rb b/db/migrate/20140424014454_create_match_team_join_table.rb new file mode 100644 index 0000000..c2ed1b7 --- /dev/null +++ b/db/migrate/20140424014454_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/20140424014459_add_hidden_attrs_to_user.rb b/db/migrate/20140424014459_add_hidden_attrs_to_user.rb new file mode 100644 index 0000000..9b5c505 --- /dev/null +++ b/db/migrate/20140424014459_add_hidden_attrs_to_user.rb @@ -0,0 +1,6 @@ +class AddHiddenAttrsToUser < ActiveRecord::Migration + def change + add_column :users, :password_digest, :string + add_column :users, :permissions, :integer + end +end diff --git a/db/schema.rb b/db/schema.rb index efe99b5..0e9202a 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: 20140424013300) do +ActiveRecord::Schema.define(version: 20140424014459) do create_table "alerts", force: true do |t| t.integer "author_id" @@ -81,15 +81,14 @@ ActiveRecord::Schema.define(version: 20140424013300) do t.text "description" t.integer "display_order" t.text "default" - t.integer "parent_id" t.datetime "created_at" t.datetime "updated_at" end add_index "game_settings", ["game_id"], name: "index_game_settings_on_game_id" - add_index "game_settings", ["parent_id"], name: "index_game_settings_on_parent_id" create_table "games", force: true do |t| + t.integer "parent_id" t.string "name" t.integer "min_players_per_team" t.integer "max_players_per_team" @@ -103,6 +102,7 @@ ActiveRecord::Schema.define(version: 20140424013300) do end add_index "games", ["name"], name: "index_games_on_name", unique: true + add_index "games", ["parent_id"], name: "index_games_on_parent_id" create_table "hosts_tournaments", id: false, force: true do |t| t.integer "host_id", null: false -- cgit v1.2.3-2-g168b