feat: change custom SMS instances to SMS notices and all its interfaces
This commit is contained in:
parent
04f4891291
commit
0d5f5167ef
12 changed files with 153 additions and 149 deletions
21
migrations/1643996603839-change-custom-sms-to-notices.js
Normal file
21
migrations/1643996603839-change-custom-sms-to-notices.js
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
var db = require('./db')
|
||||
var smsNotices = require('../lib/sms-notices')
|
||||
|
||||
exports.up = function (next) {
|
||||
var sql = [
|
||||
`ALTER TABLE custom_messages RENAME TO sms_notices`,
|
||||
`ALTER TYPE custom_message_event RENAME TO sms_notice_event`,
|
||||
`ALTER TYPE sms_notice_event ADD VALUE 'sms_receipt'`,
|
||||
`ALTER TABLE sms_notices ADD COLUMN message_name TEXT UNIQUE NOT NULL`,
|
||||
`ALTER TABLE sms_notices ADD COLUMN enabled BOOLEAN NOT NULL DEFAULT true`
|
||||
`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))
|
||||
}
|
||||
|
||||
exports.down = function (next) {
|
||||
next()
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue