Category name is not unique, is it normal to use it in foreign key? What about using Category.name as primary key instead of id?
Hello capcom,
Thanks for your observation. I have made the change to the User model. I decided to use Category.Id with the foreign key instead.
Category.Id
Thanks for reading
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Category name is not unique, is it normal to use it in foreign key? What about using Category.name as primary key instead of id?
Hello capcom,
Thanks for your observation. I have made the change to the User model. I decided to use
Category.Id
with the foreign key instead.Thanks for reading