1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-22 19:07:54 +01:00
unleash.unleash/src/migrations/20221010114644-pat-auto-increment.js

29 lines
682 B
JavaScript
Raw Normal View History

'use strict';
exports.up = function (db, cb) {
db.runSql(
`
alter table personal_access_tokens
drop constraint personal_access_tokens_pkey;
ALTER TABLE personal_access_tokens
add column id serial primary key;
`,
cb,
);
};
exports.down = function (db, cb) {
db.runSql(
`
alter table personal_access_tokens
drop constraint personal_access_tokens_pkey;
alter table personal_access_tokens
drop column id;
alter table personal_access_tokens
add primary key (secret);
`,
cb,
);
};