feat: add custom SMS screen
feat: custom messages database migration feat: populate custom SMS screen with database data feat: custom SMS creation modal fix: small fixes on styling
This commit is contained in:
parent
0035684040
commit
3480bbf8f7
11 changed files with 301 additions and 0 deletions
20
migrations/1627518944902-custom-sms.js
Normal file
20
migrations/1627518944902-custom-sms.js
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
var db = require('./db')
|
||||
|
||||
exports.up = function (next) {
|
||||
var sql = [
|
||||
`CREATE TYPE custom_message_event AS ENUM('sms_code', 'cash_out_dispense_ready')`,
|
||||
`CREATE TABLE custom_messages (
|
||||
id UUID PRIMARY KEY,
|
||||
event custom_message_event NOT NULL,
|
||||
device_id TEXT REFERENCES devices(device_id),
|
||||
message TEXT NOT NULL
|
||||
)`,
|
||||
`CREATE UNIQUE INDEX uq_custom_message_per_device ON custom_messages (event, device_id)`
|
||||
]
|
||||
|
||||
db.multi(sql, next)
|
||||
}
|
||||
|
||||
exports.down = function (next) {
|
||||
next()
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue