Skip to content

Commit bd62f19

Browse files
author
fnkbsi
committed
Rename db migration script removed "if not exist" clauses because of compatibiliy to MySql
1 parent 0276925 commit bd62f19

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
11
-- adding tables for multi users access
22

3-
CREATE TABLE IF NOT EXISTS `webusers` (
3+
CREATE TABLE `webusers` (
44
`username` varchar(50) COLLATE utf8mb3_unicode_ci NOT NULL,
55
`password` varchar(255) COLLATE utf8mb3_unicode_ci NOT NULL,
66
`enabled` tinyint(1) NOT NULL,
77
PRIMARY KEY (`username`)
88
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
99

10-
CREATE TABLE IF NOT EXISTS `webauthorities` (
10+
CREATE TABLE `webauthorities` (
1111
`username` varchar(50) COLLATE utf8mb3_unicode_ci NOT NULL,
1212
`authority` varchar(50) COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'ROLE_USER',
1313
UNIQUE KEY `authorities_idx_1` (`username`,`authority`),
1414
CONSTRAINT `authorities_ibfk_1` FOREIGN KEY (`username`) REFERENCES `webusers` (`username`)
1515
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
1616

17-
CREATE UNIQUE INDEX IF NOT EXISTS ix_auth_username
17+
CREATE UNIQUE INDEX ix_auth_username
1818
on webauthorities (username,authority);
1919

2020
-- 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)
2222
values ('admin',
2323
'$2a$10$.Rxx4JnuX8OGJTIOCXn76euuB3dIGHHrkX9tswYt9ECKjAGyms30W',
2424
1);
2525

26-
INSERT IGNORE INTO webauthorities (username, authority)
26+
INSERT INTO webauthorities (username, authority)
2727
values ('admin', 'ROLE_ADMIN');
2828

2929

0 commit comments

Comments
 (0)