-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSchemeDB.sql
61 lines (55 loc) · 1.93 KB
/
SchemeDB.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
57
58
59
60
61
CREATE TABLE dbECommerce.usuarios(
username TEXT PRIMARY KEY NOT NULL,
password TEXT NOT NULL,
salt TEXT NOT NULL,
nombres CHAR(100),
apellidos CHAR(100),
tipoDoc CHAR(10),
documento INT,
telefono INT,
email TEXT,
direccion TEXT,
imagen TEXT,
tipoImagen CHAR(100)
);
CREATE TABLE dbECommerce.administrador(
username TEXT PRIMARY KEY NOT NULL,
password TEXT NOT NULL,
salt TEXT NOT NULL,
email TEXT
);
CREATE TABLE dbECommerce.superAdministrador(
username TEXT PRIMARY KEY NOT NULL,
password TEXT NOT NULL,
salt TEXT NOT NULL,
email TEXT
);
CREATE TABLE dbECommerce.producto(
codigo INT PRIMARY KEY NOT NULL,
nombre TEXT NOT NULL,
descripcion TEXT,
precio DOUBLE NOT NULL,
cantidad DOUBLE NOT NULL,
imagen TEXT,
tipoImagen CHAR(100)
);
CREATE TABLE dbECommerce.comentarios(
username TEXT NOT NULL,
codigo INT NOT NULL,
calificacion INT NOT NULL,
comentario TEXT,
foreign key(username) references usuarios(username),
foreign key(codigo) references producto(codigo)
);
CREATE TABLE dbECommerce.wishList(
username TEXT NOT NULL,
codigo INT NOT NULL,
foreign key(username) references usuarios(username),
foreign key(codigo) references producto(codigo)
);
/* Password = 1234 */
INSERT INTO dbECommerce.administrador (username,password,salt,email) VALUES
('admin','78f869ce6c43143a2999b5ffcf34a015fd4b4d6923420f84da1f0e6b3db8a0e9','539ab4905d2354fbee2f32d17d19ac91ff909a4a773caef471978cd2f313946c','[email protected]' );
/* Password = 1234 */
INSERT INTO dbECommerce.superAdministrador (username,password,salt,email) VALUES
('superadmin','a40235ce8e810a2c015d5866e16cdd3611b9d86997df683f053fd83cf7fa01a7','7b01b0a519ab8c4e57e66089f54f469bf2b80ace337b61fea88638db4aa88837','[email protected]' );