1
I’m starting in the world of Rails through the book Ruby on Rails - Put your web app on track.
After creating a module "users" the guide informs us to add in the migration the following command line:
add_index :users, :email, :uniqueness => true
And later perform a "rake db:migrate". But when performing, the rake is aborted as per image. Someone could help?
Another detail is that when I change uniqueness
for unique
migration works. What’s the difference between them?
An index is usually used Unic, ja the uniqueness is used for validations before Insert for example.
– Luiz Picolo
Uniquess and validation for record exclusivity. Unique is correct when running a rake db:migrate.
– Bruno Fonseca