rkoron007 / AtSea

AtSea A Nautical Etsy Clone
3 stars 0 forks source link

Database Schema #1

Closed xnanodax closed 6 years ago

xnanodax commented 6 years ago

Database Schema

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.

rkoron007 commented 6 years ago

Corrected text inputs, inserted back_ticks, and added indexes where needed.

xnanodax commented 6 years ago

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

xnanodax commented 6 years ago

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.

rkoron007 commented 6 years ago

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.

xnanodax commented 6 years ago

Awesome!