Skip to content

Add ItemPurchase model to track purchases - #1

Open
maxmux-xyz wants to merge 1 commit into
masterfrom
11-19-add_itempurchase_model_to_track_purchases
Open

Add ItemPurchase model to track purchases#1
maxmux-xyz wants to merge 1 commit into
masterfrom
11-19-add_itempurchase_model_to_track_purchases

Conversation

@maxmux-xyz

Copy link
Copy Markdown
  • Introduced a new ItemPurchase model to the SQL database, which includes fields for id, item_id, user_id, quantity, and created_at.
  • Implemented foreign key relationships for item_id and user_id with cascade deletion.
  • Added validation to ensure quantity is greater than or equal to 1.
  • Default value for created_at set to the current timestamp in UTC format.

- Introduced a new `ItemPurchase` model to the SQL database, which includes fields for `id`, `item_id`, `user_id`, `quantity`, and `created_at`.
- Implemented foreign key relationships for `item_id` and `user_id` with cascade deletion.
- Added validation to ensure `quantity` is greater than or equal to 1.
- Default value for `created_at` set to the current timestamp in UTC format.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant