mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-08-03 12:06:04 -04:00
Handling DATE_ADD
This commit is contained in:
parent
5388a37a26
commit
2e2747fb52
7 changed files with 34 additions and 7 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue