Why {unique:true} doesn't throw?
If I add 3 users with the same email address, it adds them without any issue. How can I make sure the email is unique?
I also tried with:
email: varchar('email', { length: 256, unique: true, notNull: true }).primaryKey()
3 Replies
Great, thanks
Test and let me know, also don't forget to apply this to your database...
The fact you wrote this incorrectly doesn't actually matter, since what is throwing the error here is the database and not the ORM
btw, don't forget to mark the thread as done for my OCD's sake if this fixed your issue