Fix: delete old zeroConfLimit config data after migrating
This commit is contained in:
parent
ac38a40b6c
commit
fafee1a727
1 changed files with 9 additions and 0 deletions
|
|
@ -10,6 +10,7 @@ exports.up = function (next) {
|
||||||
const mp = t.any('SELECT device_id FROM devices')
|
const mp = t.any('SELECT device_id FROM devices')
|
||||||
const [{ config }, machines] = await Promise.all([sp, mp])
|
const [{ config }, machines] = await Promise.all([sp, mp])
|
||||||
const cryptoCurrencies = config.locale_cryptoCurrencies
|
const cryptoCurrencies = config.locale_cryptoCurrencies
|
||||||
|
|
||||||
_.forEach(o => {
|
_.forEach(o => {
|
||||||
const machineId = o.device_id
|
const machineId = o.device_id
|
||||||
const cashOutConfig = configManager.getCashOut(machineId, config)
|
const cashOutConfig = configManager.getCashOut(machineId, config)
|
||||||
|
|
@ -29,6 +30,14 @@ exports.up = function (next) {
|
||||||
config[key] = Number(min)
|
config[key] = Number(min)
|
||||||
}
|
}
|
||||||
}, cryptoCurrencies)
|
}, cryptoCurrencies)
|
||||||
|
|
||||||
|
const regexp = /^cashOut_[0-9a-z]+_zeroConfLimit$/
|
||||||
|
const keysToErase = Object.keys(config).filter(key => key.match(regexp))
|
||||||
|
|
||||||
|
_.forEach(key => {
|
||||||
|
config[key] = null
|
||||||
|
}, keysToErase)
|
||||||
|
|
||||||
return settingsLoader.saveConfig(config)
|
return settingsLoader.saveConfig(config)
|
||||||
})
|
})
|
||||||
.then(() => next())
|
.then(() => next())
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue