change to cached_responses; actively prune table

This commit is contained in:
Josh Harvey 2016-05-21 17:16:27 +03:00
parent 25d782a2c5
commit 29759fe132
3 changed files with 18 additions and 11 deletions

View file

@ -3,13 +3,14 @@
var db = require('./db')
exports.up = function (next) {
db.query('CREATE TABLE IF NOT EXISTS cached_requests ( ' +
db.query('CREATE TABLE IF NOT EXISTS cached_responses ( ' +
'id serial PRIMARY KEY, ' +
'device_fingerprint text NOT NULL, ' +
'session_id uuid NOT NULL, ' +
'path text NOT NULL, ' +
'method text NOT NULL, ' +
'body json NOT NULL, ' +
'created timestampz NOT NULL DEFAULT now(), ' +
'UNIQUE (device_fingerprint, session_id, path, method) ' +
')', next)
}