Create support_logs (db & api)
This commit is contained in:
parent
b7d6f3f419
commit
62d606cc80
8 changed files with 279 additions and 58 deletions
17
migrations/1509091634946-support_logs.js
Normal file
17
migrations/1509091634946-support_logs.js
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
var db = require('./db')
|
||||
|
||||
exports.up = function (next) {
|
||||
const sql =
|
||||
[`create table support_logs (
|
||||
id uuid PRIMARY KEY,
|
||||
device_id text,
|
||||
timestamp timestamptz not null default now() )`,
|
||||
'alter table logs add column server_timestamp timestamptz not null default now() '
|
||||
]
|
||||
|
||||
db.multi(sql, next)
|
||||
}
|
||||
|
||||
exports.down = function (next) {
|
||||
next()
|
||||
}
|
||||
12
migrations/1509439657189-add_machine_name_to_devices.js
Normal file
12
migrations/1509439657189-add_machine_name_to_devices.js
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
const db = require('./db')
|
||||
|
||||
exports.up = function (next) {
|
||||
const sql = [
|
||||
'alter table devices add column name text not null'
|
||||
]
|
||||
db.multi(sql, next)
|
||||
}
|
||||
|
||||
exports.down = function (next) {
|
||||
next()
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue