Hotfix: User synchronization
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Juan Ferrer 2022-08-04 08:53:31 +02:00
parent d793dc3e09
commit 22503375b3
1 changed files with 6 additions and 0 deletions

View File

@ -56,6 +56,12 @@ module.exports = Self => {
if (!userExists) {
await Self.rawSql('CREATE USER ?@? IDENTIFIED BY ?',
[mysqlUser, this.userHost, password]);
await Self.rawSql(
`UPDATE mysql.global_priv
SET Priv = JSON_SET(Priv, '$.autogenerated' , TRUE)
WHERE User = ? AND Host = ?`,
[mysqlUser, this.userHost]
);
userExists = true;
} else {
switch (this.dbType) {