1
1
-- adding tables for multi users access
2
2
3
- CREATE TABLE IF NOT EXISTS ` webusers` (
3
+ CREATE TABLE `webusers ` (
4
4
` username` varchar (50 ) COLLATE utf8mb3_unicode_ci NOT NULL ,
5
5
` password` varchar (255 ) COLLATE utf8mb3_unicode_ci NOT NULL ,
6
6
` enabled` tinyint (1 ) NOT NULL ,
7
7
PRIMARY KEY (` username` )
8
8
) ENGINE= InnoDB DEFAULT CHARSET= utf8mb3 COLLATE= utf8mb3_unicode_ci;
9
9
10
- CREATE TABLE IF NOT EXISTS ` webauthorities` (
10
+ CREATE TABLE `webauthorities ` (
11
11
` username` varchar (50 ) COLLATE utf8mb3_unicode_ci NOT NULL ,
12
12
` authority` varchar (50 ) COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT ' ROLE_USER' ,
13
13
UNIQUE KEY ` authorities_idx_1` (` username` ,` authority` ),
14
14
CONSTRAINT ` authorities_ibfk_1` FOREIGN KEY (` username` ) REFERENCES ` webusers` (` username` )
15
15
) ENGINE= InnoDB DEFAULT CHARSET= utf8mb3 COLLATE= utf8mb3_unicode_ci;
16
16
17
- CREATE UNIQUE INDEX IF NOT EXISTS ix_auth_username
17
+ CREATE UNIQUE INDEX ix_auth_username
18
18
on webauthorities (username,authority);
19
19
20
20
-- Insert a user = admin with the password = pass. Change password after installing!
21
- INSERT IGNORE INTO webusers (username, password, enabled)
21
+ INSERT INTO webusers (username, password, enabled)
22
22
values (' admin' ,
23
23
' $2a$10$.Rxx4JnuX8OGJTIOCXn76euuB3dIGHHrkX9tswYt9ECKjAGyms30W' ,
24
24
1 );
25
25
26
- INSERT IGNORE INTO webauthorities (username, authority)
26
+ INSERT INTO webauthorities (username, authority)
27
27
values (' admin' , ' ROLE_ADMIN' );
28
28
29
29
0 commit comments