lamassu-server/packages/server/migrations/1750000000000-add-lnbits-config.js
padreug 0f64df1d69 refactor: update LNBits migration to use configuration object
- Replaced SQL statements with a configuration object for LNBits settings, enhancing code clarity and maintainability.
- Simplified the migration process by utilizing the saveConfig function for applying configurations.
- Marked the down migration as a no-op to prevent breaking existing configurations.
2025-10-12 14:24:29 +02:00

17 lines
No EOL
412 B
JavaScript

const { saveConfig } = require('../lib/new-settings-loader')
exports.up = function (next) {
const config = {
'lnbits_endpoint': '',
'lnbits_adminKey': '',
'LN_wallet': 'lnbits'
}
saveConfig(config).then(next).catch(next)
}
exports.down = function (next) {
// No-op - removing config entries is not typically done in down migrations
// as it could break existing configurations
next()
}