Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve database schema #56

Closed
5 of 8 tasks
creme332 opened this issue Mar 28, 2024 · 0 comments · Fixed by #120
Closed
5 of 8 tasks

Improve database schema #56

creme332 opened this issue Mar 28, 2024 · 0 comments · Fixed by #120
Assignees
Labels
help wanted Extra attention is needed priority: critical
Milestone

Comments

@creme332
Copy link
Member

creme332 commented Mar 28, 2024

Current issues

Store location 🔴

street, city, and district_id in the order table represent the store location where the client is expected to pick up his order. This data is duplicated in multiple orders and is difficult to maintain.

The solution is to create a store table with attributes store_id, street, city, and district_id. Other possible attribtutes: phone_no, ... Also store the latitude and longitude of the store: this information can be used later for plotting store locations on a map.

Store details 🟢

Additional information worth storing: opening and closing hours, phone_no

Nested reviews 🔴

A review can reply to another review and all reviews contain a rating. It does not make sense for a subreview to have a rating.

A solution is to create a comment entity where each review can have a comment. A comment can also reply to another comment. The comment entity will only contain the following attributes: comment_id, parent_comment_id, review_id, ...

Sort product by latest 🟡

it is not possible to sort products by newest first.

A solution is add created_date to product table.

Product stock level 🔴

The stock level of a product is not necessarily the same in all coffee store locations.

Review 🟡

Reviews posted on the same date cannot be sorted by date because of the lack of time information.

  • Use datetime instead of date datatype in review table.

To-do

  • Create a new ERD
  • Create a class diagram
  • Update documentation
  • Update models accordingly
  • Update stock level trigger
  • Update tests accordingly
  • Update testing database
@creme332 creme332 self-assigned this Mar 28, 2024
@creme332 creme332 changed the title fix issues with database schema improve database schema Mar 28, 2024
@creme332 creme332 added this to the Semester 1 submission milestone Mar 28, 2024
@creme332 creme332 added the help wanted Extra attention is needed label Mar 30, 2024
@creme332 creme332 changed the title improve database schema Improve database schema Apr 7, 2024
@creme332 creme332 linked a pull request Apr 24, 2024 that will close this issue
7 tasks
@creme332 creme332 mentioned this issue Apr 24, 2024
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed priority: critical
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant