1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-22 19:07:54 +01:00
unleash.unleash/src/migrations/20220912165344-pat-tokens.js
sjaanus 2a54ace005
Add description to PAT (#2090)
* Add description to PAT

* Add tests
2022-09-26 15:42:39 +03:00

21 lines
581 B
JavaScript

'use strict';
exports.up = function (db, cb) {
db.runSql(
`
CREATE TABLE personal_access_tokens (
secret text not null primary key,
description text,
user_id integer not null references users (id) ON DELETE CASCADE,
expires_at timestamp with time zone NOT NULL,
seen_at timestamp with time zone,
created_at timestamp with time zone not null DEFAULT now()
);`,
cb,
);
};
exports.down = function (db, cb) {
db.runSql(`drop table personal_access_tokens`, cb);
};