From eb57a10bbe17c5c2c575f28a0b79be34f50d1a5d Mon Sep 17 00:00:00 2001 From: Thastertyn Date: Fri, 8 Mar 2024 14:03:52 +0100 Subject: [PATCH] Slight looks change, nothing technical --- shop.sql | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/shop.sql b/shop.sql index 1b036d8..b6970c6 100644 --- a/shop.sql +++ b/shop.sql @@ -18,8 +18,8 @@ create table user_role( role varchar(32) not null unique ); -insert into user_role(role) values ('normal') -insert into user_role(role) values ('admin') +insert into user_role(id, role) values (1, 'normal'); +insert into user_role(id, role) values (2, 'admin'); create table user_statistics( id int primary key, @@ -77,7 +77,6 @@ create table purchase_item( foreign key (product_id) references product(id) ); -delimiter // create trigger after_user_insert after insert on user for each row @@ -85,10 +84,7 @@ begin insert into user_statistics(id) values (new.id); insert into cart(id) values (new.id); end; -// -delimiter; -delimiter // create trigger after_user_delete after delete on user for each row @@ -96,10 +92,7 @@ begin delete from user_statistics where id = old.id; delete from cart where id = old.id; end; -// -delimiter; -delimiter // create trigger after_cart_insert after insert on cart_item for each row @@ -112,10 +105,7 @@ begin ) where id = new.cart_id; end; -// -delimiter; -delimiter // create trigger after_cart_delete after delete on cart_item for each row @@ -129,10 +119,7 @@ begin ) where id = old.cart_id; end; -// -delimiter; -delimiter // create trigger calculate_price_subtotal before insert on cart_item for each row @@ -142,6 +129,4 @@ begin from product p where p.id = new.product_id ); -end; -// -delimiter; \ No newline at end of file +end; \ No newline at end of file