Skip to content

Commit

Permalink
Added a CHECK constraint to ensure that the 'total_amount' in the 'or…
Browse files Browse the repository at this point in the history
…ders' table is greater than or equal to the sum of 'price' times 'quantity' in corresponding 'order_items'. (#150)

Co-authored-by: GitHub Gen Changes <>
  • Loading branch information
ariga-bot authored Feb 13, 2025
1 parent aec038e commit 934ece6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dirs/ecommerce/schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -167,4 +167,4 @@ CREATE TABLE `payment_methods` (
PRIMARY KEY (`id`),
INDEX `user_id` (`user_id`),
CONSTRAINT `payment_methods_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON UPDATE NO ACTION ON DELETE CASCADE
) CHARSET utf8mb4 COLLATE utf8mb4_0900_ai_ci;
) CHARSET utf8mb4 COLLATE utf8mb4_0900_ai_ci;

0 comments on commit 934ece6

Please sign in to comment.