· 6 years ago · Apr 12, 2019, 07:34 AM
1CREATE TABLE IF NOT EXISTS `authorities` (
2 `username` varchar(50) NOT NULL,
3 `authority` varchar(50) NOT NULL,
4 UNIQUE KEY `username_authority` (`username`,`authority`),
5 CONSTRAINT `FK__users` FOREIGN KEY (`username`) REFERENCES `users` (`username`)
6) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
7
8-- Dumping data for table car_service.authorities: ~0 rows (approximately)
9/*!40000 ALTER TABLE `authorities` DISABLE KEYS */;
10INSERT INTO `authorities` (`username`, `authority`) VALUES
11 ('admin', 'ROLE_ADMIN'),
12 ('admin', 'ROLE_USER'),
13 ('misho', 'ROLE_USER');
14/*!40000 ALTER TABLE `authorities` ENABLE KEYS */;
15
16
17
18
19-- Dumping structure for table car_service.users
20CREATE TABLE IF NOT EXISTS `users` (
21 `username` varchar(50) NOT NULL,
22 `password` varchar(68) NOT NULL,
23 `enabled` tinyint(4) NOT NULL,
24 PRIMARY KEY (`username`)
25) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
26
27-- Dumping data for table car_service.users: ~0 rows (approximately)
28/*!40000 ALTER TABLE `users` DISABLE KEYS */;
29INSERT INTO `users` (`username`, `password`, `enabled`) VALUES
30 ('admin', '{noop}pass1', 1),
31 ('misho', '{noop}pass3', 1);
32/*!40000 ALTER TABLE `users` ENABLE KEYS */;