summaryrefslogtreecommitdiff
path: root/db/migrate/20140306014125_add_index_to_users_user_name.rb
diff options
context:
space:
mode:
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