mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-08-09 09:29:31 +08:00
Handling DATE_ADD
This commit is contained in:
@@ -683,6 +683,15 @@ class Database {
|
||||
static async shrink() {
|
||||
await R.exec("VACUUM");
|
||||
}
|
||||
|
||||
static sqlHourOffset() {
|
||||
if (this.dbConfig.client === "sqlite3") {
|
||||
return "DATETIME('now', ? || ' hours')";
|
||||
} else {
|
||||
return "DATE_ADD(NOW(), INTERVAL ? HOUR)";
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
module.exports = Database;
|
||||
|
Reference in New Issue
Block a user