summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorDavisLWebb <davislwebb@ymail.com>2014-03-01 20:16:14 -0500
committerDavisLWebb <davislwebb@ymail.com>2014-03-01 20:16:14 -0500
commit5f132648f847d10a9bea18935de1e312e2f1cd0a (patch)
treeb3bd20256d03673a3caf21af5f183ef37595f843 /db
parent6a572306fc6c23c92901ae8a76bce0e3dbf7b6af (diff)
Added some stuff in db/migrate
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20140220221228_create_servers.rb8
-rw-r--r--db/migrate/20140220221232_create_tournaments.rb8
-rw-r--r--db/migrate/20140220221236_create_matches.rb9
-rw-r--r--db/migrate/20140220221239_create_teams.rb8
-rw-r--r--db/migrate/20140220221247_create_user_team_pairs.rb10
-rw-r--r--db/migrate/20140220221250_create_team_match_pairs.rb10
-rw-r--r--db/migrate/20140220221254_create_alerts.rb10
-rw-r--r--db/migrate/20140220221257_create_pms.rb11
-rw-r--r--db/migrate/20140220221301_create_server_settings.rb8
-rw-r--r--db/migrate/20140228014045_create_games.rb13
-rw-r--r--db/migrate/20140228014552_create_game_attributes.rb11
-rw-r--r--db/migrate/20140228014607_create_tournament_options.rb8
-rw-r--r--db/migrate/20140228164606_create_users.rb11
-rw-r--r--db/migrate/20140301210808_add_index_to_users_email.rb8
-rw-r--r--db/migrate/20140301211316_add_index_to_users_user_name.rb7
-rw-r--r--db/migrate/20140301213814_add_password_digest_to_users.rb5
16 files changed, 145 insertions, 0 deletions
diff --git a/db/migrate/20140220221228_create_servers.rb b/db/migrate/20140220221228_create_servers.rb
new file mode 100644
index 0000000..f33241a
--- /dev/null
+++ b/db/migrate/20140220221228_create_servers.rb
@@ -0,0 +1,8 @@
+class CreateServers < ActiveRecord::Migration
+ def change
+ create_table :servers do |t|
+
+ t.timestamps
+ end
+ end
+end
diff --git a/db/migrate/20140220221232_create_tournaments.rb b/db/migrate/20140220221232_create_tournaments.rb
new file mode 100644
index 0000000..2095590
--- /dev/null
+++ b/db/migrate/20140220221232_create_tournaments.rb
@@ -0,0 +1,8 @@
+class CreateTournaments < ActiveRecord::Migration
+ def change
+ create_table :tournaments do |t|
+
+ t.timestamps
+ end
+ end
+end
diff --git a/db/migrate/20140220221236_create_matches.rb b/db/migrate/20140220221236_create_matches.rb
new file mode 100644
index 0000000..6c0c157
--- /dev/null
+++ b/db/migrate/20140220221236_create_matches.rb
@@ -0,0 +1,9 @@
+class CreateMatches < ActiveRecord::Migration
+ def change
+ create_table :matches do |t|
+ t.references :tournament, index: true
+
+ t.timestamps
+ end
+ end
+end
diff --git a/db/migrate/20140220221239_create_teams.rb b/db/migrate/20140220221239_create_teams.rb
new file mode 100644
index 0000000..dd8397d
--- /dev/null
+++ b/db/migrate/20140220221239_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/20140220221247_create_user_team_pairs.rb b/db/migrate/20140220221247_create_user_team_pairs.rb
new file mode 100644
index 0000000..2c492ac
--- /dev/null
+++ b/db/migrate/20140220221247_create_user_team_pairs.rb
@@ -0,0 +1,10 @@
+class CreateUserTeamPairs < ActiveRecord::Migration
+ def change
+ create_table :user_team_pairs do |t|
+ t.references :user, index: true
+ t.references :team, index: true
+
+ t.timestamps
+ end
+ end
+end
diff --git a/db/migrate/20140220221250_create_team_match_pairs.rb b/db/migrate/20140220221250_create_team_match_pairs.rb
new file mode 100644
index 0000000..8fac07e
--- /dev/null
+++ b/db/migrate/20140220221250_create_team_match_pairs.rb
@@ -0,0 +1,10 @@
+class CreateTeamMatchPairs < ActiveRecord::Migration
+ def change
+ create_table :team_match_pairs do |t|
+ t.references :team, index: true
+ t.references :match, index: true
+
+ t.timestamps
+ end
+ end
+end
diff --git a/db/migrate/20140220221254_create_alerts.rb b/db/migrate/20140220221254_create_alerts.rb
new file mode 100644
index 0000000..68a8e10
--- /dev/null
+++ b/db/migrate/20140220221254_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/20140220221257_create_pms.rb b/db/migrate/20140220221257_create_pms.rb
new file mode 100644
index 0000000..93bb5c6
--- /dev/null
+++ b/db/migrate/20140220221257_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/20140220221301_create_server_settings.rb b/db/migrate/20140220221301_create_server_settings.rb
new file mode 100644
index 0000000..dfdd91b
--- /dev/null
+++ b/db/migrate/20140220221301_create_server_settings.rb
@@ -0,0 +1,8 @@
+class CreateServerSettings < ActiveRecord::Migration
+ def change
+ create_table :server_settings do |t|
+
+ t.timestamps
+ end
+ end
+end
diff --git a/db/migrate/20140228014045_create_games.rb b/db/migrate/20140228014045_create_games.rb
new file mode 100644
index 0000000..59d4ef0
--- /dev/null
+++ b/db/migrate/20140228014045_create_games.rb
@@ -0,0 +1,13 @@
+class CreateGames < ActiveRecord::Migration
+ def change
+ create_table :games do |t|
+ t.text :name
+ t.integer :players_per_team
+ t.integer :teams_per_match
+ t.integer :set_rounds
+ t.integer :randomized_teams
+
+ t.timestamps
+ end
+ end
+end
diff --git a/db/migrate/20140228014552_create_game_attributes.rb b/db/migrate/20140228014552_create_game_attributes.rb
new file mode 100644
index 0000000..b63f134
--- /dev/null
+++ b/db/migrate/20140228014552_create_game_attributes.rb
@@ -0,0 +1,11 @@
+class CreateGameAttributes < ActiveRecord::Migration
+ def change
+ create_table :game_attributes do |t|
+ t.references :game, index: true
+ t.text :key
+ t.integer :type
+
+ t.timestamps
+ end
+ end
+end
diff --git a/db/migrate/20140228014607_create_tournament_options.rb b/db/migrate/20140228014607_create_tournament_options.rb
new file mode 100644
index 0000000..d2df22e
--- /dev/null
+++ b/db/migrate/20140228014607_create_tournament_options.rb
@@ -0,0 +1,8 @@
+class CreateTournamentOptions < ActiveRecord::Migration
+ def change
+ create_table :tournament_options do |t|
+
+ t.timestamps
+ end
+ end
+end
diff --git a/db/migrate/20140228164606_create_users.rb b/db/migrate/20140228164606_create_users.rb
new file mode 100644
index 0000000..1c37f38
--- /dev/null
+++ b/db/migrate/20140228164606_create_users.rb
@@ -0,0 +1,11 @@
+class CreateUsers < ActiveRecord::Migration
+ def change
+ create_table :users do |t|
+ t.string :name
+ t.string :email
+ t.string :user_name
+
+ t.timestamps
+ end
+ end
+end
diff --git a/db/migrate/20140301210808_add_index_to_users_email.rb b/db/migrate/20140301210808_add_index_to_users_email.rb
new file mode 100644
index 0000000..934d23b
--- /dev/null
+++ b/db/migrate/20140301210808_add_index_to_users_email.rb
@@ -0,0 +1,8 @@
+class AddIndexToUsersEmail < ActiveRecord::Migration
+
+# adding unique: true ensures there can be no duplicates
+ def change
+ add_index :users, :email, unique: true
+ end
+
+end
diff --git a/db/migrate/20140301211316_add_index_to_users_user_name.rb b/db/migrate/20140301211316_add_index_to_users_user_name.rb
new file mode 100644
index 0000000..22ca8c3
--- /dev/null
+++ b/db/migrate/20140301211316_add_index_to_users_user_name.rb
@@ -0,0 +1,7 @@
+class AddIndexToUsersUserName < ActiveRecord::Migration
+
+# ensures that the username is unique
+ def change
+ add_index :users, :user_name, unique: true
+ end
+end
diff --git a/db/migrate/20140301213814_add_password_digest_to_users.rb b/db/migrate/20140301213814_add_password_digest_to_users.rb
new file mode 100644
index 0000000..7ad1f62
--- /dev/null
+++ b/db/migrate/20140301213814_add_password_digest_to_users.rb
@@ -0,0 +1,5 @@
+class AddPasswordDigestToUsers < ActiveRecord::Migration
+ def change
+ add_column :users, :password_digest, :string
+ end
+end