diff options
Diffstat (limited to 'db/init.sql')
-rw-r--r-- | db/init.sql | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/db/init.sql b/db/init.sql index 4be1768..b7b3310 100644 --- a/db/init.sql +++ b/db/init.sql @@ -25,25 +25,27 @@ create table if not exists webs.product ( on update cascade ); -create table if not exists webs.customer ( +create table if not exists webs.user ( `id` int not null auto_increment, `name` varchar(45) not null, + `hash` binary(64) not null, + `privileges` int not null default 1, primary key (`id`) ); create table if not exists webs.cart ( `id` int not null auto_increment, `product` int not null, - `customer` int not null, + `user` int not null, `count` int not null default 1, primary key (`id`), constraint `cart_product_fk` foreign key (`product`) references webs.product (`id`) on update cascade, - constraint `cart_customer_fk` - foreign key (`customer`) - references webs.customer (`id`) + constraint `cart_user_fk` + foreign key (`user`) + references webs.user (`id`) on update cascade ); |