-
Notifications
You must be signed in to change notification settings - Fork 0
Schema Design Comments (Alfred Madere) #26
Copy link
Copy link
Open
Description
AlfredMadere
opened on Nov 11, 2023
Issue body actions
- Change name and email in the users table to be non-nullable to ensure every user has this essential information.
- Add a unique constraint to the email field in the users table to avoid duplicate email addresses.
- Change name in the groups table to be non-nullable to ensure every group has a name.
- In the group_members table, remove the identity property from group_id and make group_id and user_id both foreign keys to their respective tables.
- Add a unique constraint on (group_id, user_id) in group_members to prevent duplicate memberships.
- Change description and payer_id in shopping_trips to non-nullable if these fields are always expected.
- Make price and quantity non-nullable in trip_line_items and set default values if appropriate.
- expense_id in trip_line_items should not be an identity; it should be a foreign key to shopping_trips.
- In trip_item_members, user_id should not have the identity property; it should be a foreign key to users.
- Make description and expense_id non-nullable in transactions if they are always required.
- The transaction_ledger table lacks a primary key. Consider adding a unique identifier as a primary key or using (transaction_id, from_id, to_id) as a composite key.
- Ensure each field uses the most appropriate data type. For instance, if price in trip_line_items will not have fractional cents, consider using decimal instead of real for more precise financial calculations.
Reactions are currently unavailable
Activity
Metadata
Metadata
Assignees
Labels
No labels