fix: migration promise flow

This commit is contained in:
Sérgio Salgado 2022-02-18 17:16:16 +00:00
parent dcea6661ed
commit 72f91b7e36
2 changed files with 10 additions and 5 deletions

View file

@ -11,10 +11,15 @@ exports.up = function (next) {
`ALTER TABLE sms_notices ADD COLUMN allow_toggle BOOLEAN NOT NULL DEFAULT true`
]
db.multi(sql, next)
.then(() => smsNotices.createSMSNotice('sms_code', 'SMS confirmation code', 'Your cryptomat code: #code', true, false))
.then(() => smsNotices.createSMSNotice('cash_out_dispense_ready', 'Cash is ready', 'Your cash is waiting! Go to the Cryptomat and press Redeem within 24 hours. [#timestamp]', true, false))
.then(() => smsNotices.createSMSNotice('sms_receipt', 'SMS receipt', '', true, true))
db.multi(
sql,
() => Promise.all([
smsNotices.createSMSNotice('sms_code', 'SMS confirmation code', 'Your cryptomat code: #code', true, false),
smsNotices.createSMSNotice('cash_out_dispense_ready', 'Cash is ready', 'Your cash is waiting! Go to the Cryptomat and press Redeem within 24 hours. [#timestamp]', true, false),
smsNotices.createSMSNotice('sms_receipt', 'SMS receipt', '', true, true)
])
.then(() => next())
)
}
exports.down = function (next) {