mirror of
https://github.com/louislam/uptime-kuma.git
synced 2024-11-12 16:44:12 -08:00
Fix: Disable timezone conversion for mariadb (#3756)
This commit is contained in:
parent
7772a546db
commit
35479c7690
|
@ -263,7 +263,14 @@ class Database {
|
||||||
user: dbConfig.username,
|
user: dbConfig.username,
|
||||||
password: dbConfig.password,
|
password: dbConfig.password,
|
||||||
database: dbConfig.dbName,
|
database: dbConfig.dbName,
|
||||||
timezone: "+00:00",
|
timezone: "Z",
|
||||||
|
typeCast: function (field, next) {
|
||||||
|
if (field.type === "DATETIME") {
|
||||||
|
// Do not perform timezone conversion
|
||||||
|
return field.string();
|
||||||
|
}
|
||||||
|
return next();
|
||||||
|
},
|
||||||
},
|
},
|
||||||
pool: mariadbPoolConfig,
|
pool: mariadbPoolConfig,
|
||||||
};
|
};
|
||||||
|
@ -277,6 +284,14 @@ class Database {
|
||||||
socketPath: embeddedMariaDB.socketPath,
|
socketPath: embeddedMariaDB.socketPath,
|
||||||
user: "node",
|
user: "node",
|
||||||
database: "kuma",
|
database: "kuma",
|
||||||
|
timezone: "Z",
|
||||||
|
typeCast: function (field, next) {
|
||||||
|
if (field.type === "DATETIME") {
|
||||||
|
// Do not perform timezone conversion
|
||||||
|
return field.string();
|
||||||
|
}
|
||||||
|
return next();
|
||||||
|
},
|
||||||
},
|
},
|
||||||
pool: mariadbPoolConfig,
|
pool: mariadbPoolConfig,
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue