mirror of
https://github.com/Unleash/unleash.git
synced 2024-10-18 20:09:08 +02:00
22 lines
564 B
JavaScript
22 lines
564 B
JavaScript
|
'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);
|
||
|
};
|