-
-
Notifications
You must be signed in to change notification settings - Fork 409
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rename db migration script removed "if not exist" clauses because of …
…compatibiliy to MySql
- Loading branch information
fnkbsi
committed
Dec 24, 2023
1 parent
0276925
commit bd62f19
Showing
1 changed file
with
5 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,29 @@ | ||
-- adding tables for multi users access | ||
|
||
CREATE TABLE IF NOT EXISTS `webusers` ( | ||
CREATE TABLE `webusers` ( | ||
`username` varchar(50) COLLATE utf8mb3_unicode_ci NOT NULL, | ||
`password` varchar(255) COLLATE utf8mb3_unicode_ci NOT NULL, | ||
`enabled` tinyint(1) NOT NULL, | ||
PRIMARY KEY (`username`) | ||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; | ||
|
||
CREATE TABLE IF NOT EXISTS `webauthorities` ( | ||
CREATE TABLE `webauthorities` ( | ||
`username` varchar(50) COLLATE utf8mb3_unicode_ci NOT NULL, | ||
`authority` varchar(50) COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'ROLE_USER', | ||
UNIQUE KEY `authorities_idx_1` (`username`,`authority`), | ||
CONSTRAINT `authorities_ibfk_1` FOREIGN KEY (`username`) REFERENCES `webusers` (`username`) | ||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; | ||
|
||
CREATE UNIQUE INDEX IF NOT EXISTS ix_auth_username | ||
CREATE UNIQUE INDEX ix_auth_username | ||
on webauthorities (username,authority); | ||
|
||
-- Insert a user = admin with the password = pass. Change password after installing! | ||
INSERT IGNORE INTO webusers (username, password, enabled) | ||
INSERT INTO webusers (username, password, enabled) | ||
values ('admin', | ||
'$2a$10$.Rxx4JnuX8OGJTIOCXn76euuB3dIGHHrkX9tswYt9ECKjAGyms30W', | ||
1); | ||
|
||
INSERT IGNORE INTO webauthorities (username, authority) | ||
INSERT INTO webauthorities (username, authority) | ||
values ('admin', 'ROLE_ADMIN'); | ||
|
||
|