-
Notifications
You must be signed in to change notification settings - Fork 1
/
g_vente.sql
55 lines (47 loc) · 1.59 KB
/
g_vente.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
DROP database if exists g_vente;
create database g_vente;
use g_vente;
CREATE TABLE `produits_prix` (
`code_pdt` int NOT NULL AUTO_INCREMENT,
`nom_pdt` varchar(20) DEFAULT NULL,
`desc_pdt` varchar(200) DEFAULT NULL,
`prix_pdt` int(11) DEFAULT NULL,
PRIMARY KEY (`code_pdt`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
CREATE TABLE `commandes` (
`code_cmd` int NOT NULL AUTO_INCREMENT,
`client` varchar(20) DEFAULT NULL,
`code_pdt` int DEFAULT NULL,
`qte_cmd` int DEFAULT NULL,
`date_cmd` date DEFAULT NULL,
PRIMARY KEY (`code_cmd`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*DROP TABLE IF EXISTS `users`*/;
CREATE TABLE `users` (
`username` varchar(50) NOT NULL,
`password` char(68) NOT NULL,
`enabled` tinyint(1) NOT NULL,
PRIMARY KEY (`username`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
INSERT INTO `users`
VALUES
('john','{bcrypt}$2a$04$eFytJDGtjbThXa80FyOOBuFdK2IwjyWefYkMpiBEFlpBwDH.5PM0K',1),
('mary','{bcrypt}$2a$04$eFytJDGtjbThXa80FyOOBuFdK2IwjyWefYkMpiBEFlpBwDH.5PM0K',1),
('susan','{bcrypt}$2a$04$eFytJDGtjbThXa80FyOOBuFdK2IwjyWefYkMpiBEFlpBwDH.5PM0K',1);
/*DROP TABLE IF EXISTS `authorities`*/;
CREATE TABLE `authorities` (
`username` varchar(50) NOT NULL,
`authority` varchar(50) NOT NULL,
UNIQUE KEY `authorities_idx_1` (`username`,`authority`),
CONSTRAINT `authorities_ibfk_1` FOREIGN KEY (`username`) REFERENCES `users` (`username`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `authorities`
--
INSERT INTO `authorities`
VALUES
('john','ROLE_EMPLOYEE'),
('mary','ROLE_EMPLOYEE'),
('mary','ROLE_MANAGER'),
('susan','ROLE_EMPLOYEE'),
('susan','ROLE_ADMIN');