-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.sql
56 lines (51 loc) · 1.46 KB
/
init.sql
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
46
47
48
49
50
51
52
53
54
55
56
CREATE TABLE IF NOT EXISTS users (
created_at TIMESTAMP,
updated_at TIMESTAMP,
deleted_at TIMESTAMP,
id int PRIMARY KEY GENERATED ALWAYS AS IDENTITY,
firstname varchar(255) not null,
lastname varchar(255),
password varchar(255) not null,
email varchar(255) not null
);
CREATE TABLE IF NOT EXISTS user_logins (
created_at TIMESTAMP,
updated_at TIMESTAMP,
deleted_at TIMESTAMP,
id int PRIMARY KEY GENERATED ALWAYS AS IDENTITY,
user_id int not null
);
CREATE TABLE IF NOT EXISTS sellers (
created_at TIMESTAMP,
updated_at TIMESTAMP,
deleted_at TIMESTAMP,
id int PRIMARY KEY GENERATED ALWAYS AS IDENTITY,
storename varchar(255) not null,
password varchar(255) not null,
email varchar(255) not null
);
CREATE TABLE IF NOT EXISTS seller_logins (
created_at TIMESTAMP,
updated_at TIMESTAMP,
deleted_at TIMESTAMP,
id int PRIMARY KEY GENERATED ALWAYS AS IDENTITY,
seller_id int not null
);
CREATE TABLE IF NOT EXISTS products (
created_at TIMESTAMP,
updated_at TIMESTAMP,
deleted_at TIMESTAMP,
id int PRIMARY KEY GENERATED ALWAYS AS IDENTITY,
seller_id int not null,
name varchar(255) not null,
price int not null,
image varchar(255) not null
);
CREATE TABLE IF NOT EXISTS cart (
created_at TIMESTAMP,
updated_at TIMESTAMP,
deleted_at TIMESTAMP,
id int PRIMARY KEY GENERATED ALWAYS AS IDENTITY,
product_id int not null,
price int not null
);