Closed xnanodax closed 6 years ago
Corrected text inputs, inserted back_ticks, and added indexes where needed.
Currently, you have a item_id
with a unique constraint. That means the item_id will only show up ONCE on the table, regardless of the user. I'm not sure if you want the uniqueness constraint just on item_id
For the items, did you want to add a quantity? Etsy sells hand made one of a kind items as well as mass produced items. Did you want to add that functionality to your website? Your choice. I'm making this a separate comment because this design choice will change your backend drastically.
I think that users will create items on order request. So I will not have a set inventory.....unless you advise me otherwise! :)
I added a uniqueness trait to userIds for the cart too. So if I understand correctly: this one user will have a shopping cart with multiple items. If there is multiple of that item in that cart we will just increase the quantity of that item in the cart instead of having multiple table lines with the same id.
I'm not sure exactly how to do that through so let me know if I'm completely off track.
Awesome!
Database Schema
[x] Contains correct datatypes NOTE: Certain fields should change their data type to
text
instead ofstring
[x] Contains appropriate constraints/details
[x] Contains bullet points after the table that state which foreign keys will reference to which table, or references to the associations which will be made
[x] Correctly formatted
back_ticks
Comments:
I saw on your state that ratings can be floats. You may want to change the data type for rating. Keep in mind the current state of the db schema allows one item to have one picture. I think this is totally fine now however, in the future if you want an item to have multiple pictures, you'll need an images table and an images_items join table.