diff options
Diffstat (limited to 'db/migrate/20140306014123_add_index_to_users_email.rb')
-rw-r--r-- | db/migrate/20140306014123_add_index_to_users_email.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/db/migrate/20140306014123_add_index_to_users_email.rb b/db/migrate/20140306014123_add_index_to_users_email.rb index b5f8a1a..934d23b 100644 --- a/db/migrate/20140306014123_add_index_to_users_email.rb +++ b/db/migrate/20140306014123_add_index_to_users_email.rb @@ -1,4 +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 |