Closed ieow closed 3 years ago
At the moment, the only way to set a unique constraint on a column would be to manually edit the migration sql after it's generated. It should be fairly straightforward to add a #[unique] field attribute though. Let me see if I can take a stab at that tonight.
Thanks for the workaround! Thanks also for considering to implement #[unique] feature !!
Took a couple days before I found the time I'm afraid, but I've just published 0.3.1 with #[unique]. Let me know if you see any issues!
Closing, as this is implemented in 0.3.1 and I haven't heard any feedback. Feel free to reopen if you see issues.
Just tried it with 0.3.1. It works great!
How to se the column as unique? Is there a field such as #[unique] (as same as #[pk]) to define the column as unique data?