This commit is contained in:
Josh Harvey 2016-10-26 04:10:23 +03:00
parent 22e58844c9
commit 9c57b1de87
4 changed files with 88 additions and 30 deletions

View 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()
}