summaryrefslogtreecommitdiff
path: root/db/migrate/20140306014125_add_index_to_users_user_name.rb
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2014-03-05 21:08:07 -0500
committerLuke Shumaker <LukeShu@sbcglobal.net>2014-03-05 21:08:07 -0500
commit11b6cab4a9a7d14e6b58c6a16f471aabaa42247f (patch)
tree2bfde1e22d5f93529cd2cf79b795fc8b574f72be /db/migrate/20140306014125_add_index_to_users_user_name.rb
parent0b9460c1af2619a6158141b01ba77836cc8a9e74 (diff)
parent0d710239a765787f10de304edc438de2dfaa9824 (diff)
Merge branch 'clean'
Conflicts: app/controllers/sessions_controller.rb app/views/sessions/new.html.erb config/routes.rb
Diffstat (limited to 'db/migrate/20140306014125_add_index_to_users_user_name.rb')
-rw-r--r--db/migrate/20140306014125_add_index_to_users_user_name.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/db/migrate/20140306014125_add_index_to_users_user_name.rb b/db/migrate/20140306014125_add_index_to_users_user_name.rb
new file mode 100644
index 0000000..22ca8c3
--- /dev/null
+++ b/db/migrate/20140306014125_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