-
Notifications
You must be signed in to change notification settings - Fork 1
/
tbl
45 lines (42 loc) · 1.97 KB
/
tbl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
CREATE TABLE IF NOT EXISTS public.login_details_tbl
(
id integer NOT NULL DEFAULT nextval('login_details_tbl_id_seq'::regclass),
username character varying(255) COLLATE pg_catalog."default",
firstname character varying(255) COLLATE pg_catalog."default",
lastname character varying(255) COLLATE pg_catalog."default",
password character varying(255) COLLATE pg_catalog."default",
user_role integer,
profile character varying(255) COLLATE pg_catalog."default",
email character varying(255) COLLATE pg_catalog."default",
CONSTRAINT login_details_tbl_pkey PRIMARY KEY (id)
)
CREATE TABLE IF NOT EXISTS public.product_details_tbl
(
id integer NOT NULL DEFAULT nextval('product_details_tbl_id_seq'::regclass),
productname character varying(255) COLLATE pg_catalog."default",
productcount character varying(255) COLLATE pg_catalog."default",
fileuploaded character varying(255) COLLATE pg_catalog."default",
productprice integer,
productdescription character varying(255) COLLATE pg_catalog."default",
producttypes character varying(255) COLLATE pg_catalog."default",
CONSTRAINT product_details_tbl_pkey PRIMARY KEY (id)
)
CREATE TABLE IF NOT EXISTS public.cart_details_tbl
(
id integer NOT NULL DEFAULT nextval('cart_details_tbl_id_seq'::regclass),
itemid integer,
userid integer,
productname character varying(255) COLLATE pg_catalog."default",
productcount character varying(255) COLLATE pg_catalog."default",
fileuploaded character varying(255) COLLATE pg_catalog."default",
productprice integer,
CONSTRAINT cart_details_tbl_pkey PRIMARY KEY (id),
CONSTRAINT cart_details_tbl_itemid_fkey FOREIGN KEY (itemid)
REFERENCES public.product_details_tbl (id) MATCH SIMPLE
ON UPDATE NO ACTION
ON DELETE NO ACTION,
CONSTRAINT cart_details_tbl_userid_fkey FOREIGN KEY (userid)
REFERENCES public.login_details_tbl (id) MATCH SIMPLE
ON UPDATE NO ACTION
ON DELETE NO ACTION
)