· 6 years ago · Nov 18, 2019, 12:30 PM
1CREATE DATABASE IF NOT EXISTS `db_manolito` /*!40100 DEFAULT CHARACTER SET latin1 */;
2USE `db_manolito`;
3-- MySQL dump 10.13 Distrib 8.0.17, for Win64 (x86_64)
4--
5-- Host: localhost Database: db_manolito
6-- ------------------------------------------------------
7-- Server version 5.7.27-log
8
9/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
10/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
11/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
12/*!50503 SET NAMES utf8 */;
13/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
14/*!40103 SET TIME_ZONE='+00:00' */;
15/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
16/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
17/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
18/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
19
20--
21-- Table structure for table `permissions`
22--
23
24DROP TABLE IF EXISTS `permissions`;
25/*!40101 SET @saved_cs_client = @@character_set_client */;
26/*!50503 SET character_set_client = utf8mb4 */;
27CREATE TABLE `permissions` (
28 `id` int(4) NOT NULL AUTO_INCREMENT COMMENT 'Permission id',
29 `name` varchar(20) DEFAULT NULL COMMENT 'Name of permission',
30 PRIMARY KEY (`id`)
31) ENGINE=InnoDB COMMENT='Permission table for url accesses' AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
32/*!40101 SET character_set_client = @saved_cs_client */;
33
34--
35-- Dumping data for table `permissions`
36--
37
38LOCK TABLES `permissions` WRITE;
39/*!40000 ALTER TABLE `permissions` DISABLE KEYS */;
40INSERT INTO `permissions` VALUES (1,'ROLE_COSAS');
41/*!40000 ALTER TABLE `permissions` ENABLE KEYS */;
42UNLOCK TABLES;
43
44--
45-- Table structure for table `roles`
46--
47
48DROP TABLE IF EXISTS `roles`;
49/*!40101 SET @saved_cs_client = @@character_set_client */;
50/*!50503 SET character_set_client = utf8mb4 */;
51CREATE TABLE `roles` (
52 `id` int(4) NOT NULL AUTO_INCREMENT COMMENT 'Role id',
53 `name` varchar(20) DEFAULT NULL COMMENT 'Name of the role',
54 PRIMARY KEY (`id`)
55) ENGINE=InnoDB COMMENT='Role table for grouping permissions' AUTO_INCREMENT=3 DEFAULT CHARSET=latin1;
56/*!40101 SET character_set_client = @saved_cs_client */;
57
58--
59-- Dumping data for table `roles`
60--
61
62LOCK TABLES `roles` WRITE;
63/*!40000 ALTER TABLE `roles` DISABLE KEYS */;
64INSERT INTO `roles` VALUES (1,'ROLE_ADMIN'),(2,'ROLE_USER');
65/*!40000 ALTER TABLE `roles` ENABLE KEYS */;
66UNLOCK TABLES;
67
68--
69-- Table structure for table `roles_permissions`
70--
71
72DROP TABLE IF EXISTS `roles_permissions`;
73/*!40101 SET @saved_cs_client = @@character_set_client */;
74/*!50503 SET character_set_client = utf8mb4 */;
75CREATE TABLE `roles_permissions` (
76 `role_id` bigint(20) NOT NULL,
77 `permissions_id` bigint(20) NOT NULL,
78 UNIQUE KEY `UK_oll9subcln0cdjt31bp72a3uv` (`permissions_id`),
79 KEY `FKqi9odri6c1o81vjox54eedwyh` (`role_id`),
80 CONSTRAINT `FK570wuy6sacdnrw8wdqjfh7j0q` FOREIGN KEY (`permissions_id`) REFERENCES `permissions` (`id`),
81 CONSTRAINT `FKqi9odri6c1o81vjox54eedwyh` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`)
82) ENGINE=InnoDB DEFAULT CHARSET=latin1;
83/*!40101 SET character_set_client = @saved_cs_client */;
84
85--
86-- Dumping data for table `roles_permissions`
87--
88
89LOCK TABLES `roles_permissions` WRITE;
90/*!40000 ALTER TABLE `roles_permissions` DISABLE KEYS */;
91INSERT INTO `roles_permissions` VALUES (1,1);
92/*!40000 ALTER TABLE `roles_permissions` ENABLE KEYS */;
93UNLOCK TABLES;
94
95--
96-- Table structure for table `user_details`
97--
98
99DROP TABLE IF EXISTS `user_details`;
100/*!40101 SET @saved_cs_client = @@character_set_client */;
101/*!50503 SET character_set_client = utf8mb4 */;
102CREATE TABLE `user_details` (
103 `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'Id of the user',
104 `dasid` varchar(7) NOT NULL COMMENT 'Id of the user that customers will see, set or change',
105 `email` varchar(255) NOT NULL COMMENT 'Email of the user',
106 `last_name` varchar(40) DEFAULT NULL COMMENT 'First surname of the user',
107 `location` varchar(20) DEFAULT NULL COMMENT 'Office or company name that the user works on',
108 `name` varchar(20) DEFAULT NULL COMMENT 'Name of the user',
109 `status` varchar(1) NOT NULL COMMENT 'Status of the user. It can be Active(A), Inactive(I), Pending(P) or Blocked(B)',
110 `surname2` varchar(40) DEFAULT NULL COMMENT 'Second surname of the user',
111 PRIMARY KEY (`id`),
112 UNIQUE KEY `UK_wcvs0jlp2br5w65bglga5hy1` (`dasid`)
113) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1 COMMENT 'User fundamental data. Here we store fields such as roles, status and dasid which will determine what permissions he will have and what kind of accesses';
114/*!40101 SET character_set_client = @saved_cs_client */;
115
116--
117-- Dumping data for table `user_details`
118--
119
120LOCK TABLES `user_details` WRITE;
121/*!40000 ALTER TABLE `user_details` DISABLE KEYS */;
122INSERT INTO `user_details` VALUES (1,'a123456','asd1f@gmail.com','apellido','atos','Manolito','A','apellido2'),(2,'a333333','asd2f@gmail.com','apellido','indra','Pepe','A','apellido2'),(3,'a222222','asd3f@gmail.com','apellido','imatia','Fernando','A','apellido2');
123/*!40000 ALTER TABLE `user_details` ENABLE KEYS */;
124UNLOCK TABLES;
125
126--
127-- Table structure for table `user_details_roles`
128--
129
130DROP TABLE IF EXISTS `user_details_roles`;
131/*!40101 SET @saved_cs_client = @@character_set_client */;
132/*!50503 SET character_set_client = utf8mb4 */;
133CREATE TABLE `user_details_roles` (
134 `user_id` bigint(20) NOT NULL,
135 `role_id` bigint(20) NOT NULL,
136 KEY `FKb48hks4x9aq8jp80knkm5uj6w` (`role_id`),
137 KEY `FKpu8elkbgi46pmghqsodex3xdw` (`user_id`),
138 CONSTRAINT `FKb48hks4x9aq8jp80knkm5uj6w` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`),
139 CONSTRAINT `FKpu8elkbgi46pmghqsodex3xdw` FOREIGN KEY (`user_id`) REFERENCES `user_details` (`id`)
140) ENGINE=InnoDB DEFAULT CHARSET=latin1;
141/*!40101 SET character_set_client = @saved_cs_client */;
142
143--
144-- Dumping data for table `user_details_roles`
145--
146
147LOCK TABLES `user_details_roles` WRITE;
148/*!40000 ALTER TABLE `user_details_roles` DISABLE KEYS */;
149INSERT INTO `user_details_roles` VALUES (1,1),(1,2),(2,2);
150/*!40000 ALTER TABLE `user_details_roles` ENABLE KEYS */;
151UNLOCK TABLES;
152
153--
154-- Table structure for table `users`
155--
156
157DROP TABLE IF EXISTS `users`;
158/*!40101 SET @saved_cs_client = @@character_set_client */;
159/*!50503 SET character_set_client = utf8mb4 */;
160CREATE TABLE `users` (
161 `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'Id of the user',
162 `counter` int(11) NOT NULL COMMENT 'User login fail counter. Supposed to be used to count the number of times an user fails to write their password properly',
163 `password` varchar(60) DEFAULT NULL COMMENT 'Crypted password of the user',
164 PRIMARY KEY (`id`),
165 UNIQUE KEY `UK_r53o2ojjw4fikudfnsuuga336` (`password`)
166) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1 COMMENT 'User password table. Here we store the crypted passwords of the users and a login fail counter';
167/*!40101 SET character_set_client = @saved_cs_client */;
168
169--
170-- Dumping data for table `users`
171--
172
173LOCK TABLES `users` WRITE;
174/*!40000 ALTER TABLE `users` DISABLE KEYS */;
175INSERT INTO `users` VALUES (1,0,'$2a$10$ffOKwiWysIi06Xq0xPyYwO8nH3F2OP15Ui3/vQzvxo.2wpNu3dlei'),(2,0,'$2a$10$Vz0oxS.dWEPgN5gM4EV8F.dwUkPVRz1bH9MPtS/5WKJrAA2cO15yS'),(3,0,'$2a$10$RNLVEKGPPK78YwfmFQEGcuoOSxQXbiLhveC3UsuZh2KJb59CTKKjS');
176/*!40000 ALTER TABLE `users` ENABLE KEYS */;
177UNLOCK TABLES;
178
179--
180-- Dumping events for database 'db_manolito'
181--
182
183--
184-- Dumping routines for database 'db_manolito'
185--
186/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
187
188/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
189/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
190/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
191/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
192/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
193/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
194/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
195
196-- Dump completed on 2019-11-18 11:29:23