WIP
This commit is contained in:
parent
22e58844c9
commit
9c57b1de87
4 changed files with 88 additions and 30 deletions
20
migrations/016-new_cached_requests_table.js
Normal file
20
migrations/016-new_cached_requests_table.js
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
var db = require('./db')
|
||||
|
||||
exports.up = function (next) {
|
||||
var sql = [
|
||||
'drop table if exists cached_responses',
|
||||
`create table idempotents (
|
||||
request_id text PRIMARY KEY,
|
||||
device_id text NOT NULL,
|
||||
body json NOT NULL,
|
||||
status integer NOT NULL,
|
||||
pending boolean NOT NULL,
|
||||
created timestamptz NOT NULL default now()
|
||||
)`
|
||||
]
|
||||
db.multi(sql, next)
|
||||
}
|
||||
|
||||
exports.down = function (next) {
|
||||
next()
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue