1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-10-18 20:09:08 +02:00
unleash.unleash/src/migrations/20210322104356-api-tokens-table.js

22 lines
564 B
JavaScript
Raw Normal View History

2021-03-29 19:58:11 +02:00
'use strict';
exports.up = function(db, cb) {
db.runSql(
`CREATE TABLE IF NOT EXISTS api_tokens
(
secret text not null PRIMARY KEY,
username text not null,
type text not null,
created_at TIMESTAMP WITH TIME ZONE DEFAULT now(),
expires_at TIMESTAMP WITH TIME ZONE,
seen_at TIMESTAMP WITH TIME ZONE
);
`,
cb,
);
};
exports.down = function(db, cb) {
db.runSql('DROP TABLE IF EXISTS api_tokens;', cb);
};