-
Notifications
You must be signed in to change notification settings - Fork 0
/
db.txt
49 lines (49 loc) · 1.29 KB
/
db.txt
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
CREATE TABLE IF NOT EXISTS features(
id INT AUTO_INCREMENT,
features TEXT,
main_feature TEXT,
productId INT REFERENCES products(id),
PRIMARY KEY (id)
);
CREATE TABLE IF NOT EXISTS reviews(
id INT AUTO_INCREMENT,
reviewer VARCHAR(128) not null,
review TEXT not null,
rating int,
created DATE,
modified DATE,
productId INT REFERENCES products(id),
PRIMARY KEY (id)
);
CREATE TABLE IF NOT EXISTS users(
id INT AUTO_INCREMENT,
first_name VARCHAR(128) not null,
last_name VARCHAR(128) not null,
email VARCHAR(128) not null,
sPassword VARCHAR(128) not null,
isAdmin tinyint default 0,
created DATE,
modified DATE,
PRIMARY KEY (id)
);
CREATE TABLE IF NOT EXISTS products (
id INT not null AUTO_INCREMENT,
name VARCHAR(255) NOT NULL,
brand VARCHAR(32) NOT NULL,
warranty VARCHAR(255),
color VARCHAR(12),
primaryImage VARCHAR(255) NOT NULL,
publisher VARCHAR(32),
inStock TINYINT(1),
isActive TINYINT(1),
description TEXT,
retailPrice DECIMAL(8,2) NOT NULL,
splPrice DECIMAL(8,2),
discount INT,
created DATE,
modified DATE,
categoryId INT NOT NULL REFERENCES categories(id),
reviewId INT REFERENCES reviews(id),
featuresId INT REFERENCES features(id),
PRIMARY KEY (id)
);