mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-07-24 07:21:09 -04:00
add db migration
This commit is contained in:
parent
1c0dc18d72
commit
e02eb72863
4 changed files with 198 additions and 28 deletions
|
@ -45,6 +45,18 @@ exports.setting = async function (key) {
|
|||
])
|
||||
}
|
||||
|
||||
exports.setSetting = async function (key, value) {
|
||||
let bean = await R.findOne("setting", " `key` = ? ", [
|
||||
key
|
||||
])
|
||||
if (! bean) {
|
||||
bean = R.dispense("setting")
|
||||
bean.key = key;
|
||||
}
|
||||
bean.value = value;
|
||||
await R.store(bean)
|
||||
}
|
||||
|
||||
exports.getSettings = async function (type) {
|
||||
let list = await R.getAll("SELECT * FROM setting WHERE `type` = ? ", [
|
||||
type
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue