mirror of
https://github.com/Unleash/unleash.git
synced 2025-02-04 00:18:01 +01:00
Migration for API key metadata (#1930)
* feat: add metadata to api_keys * fix: default to empty object for metadata Co-authored-by: Fredrik Oseberg <fredrik.no@gmail.com>
This commit is contained in:
parent
e8d542af0f
commit
45c6464587
12
src/migrations/20220816121136-add-metadata-to-api-keys.js
Normal file
12
src/migrations/20220816121136-add-metadata-to-api-keys.js
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
'use strict';
|
||||||
|
|
||||||
|
exports.up = function (db, cb) {
|
||||||
|
db.runSql(
|
||||||
|
`ALTER TABLE api_tokens ADD COLUMN metadata JSONB NOT NULL DEFAULT '{}'::jsonb;`,
|
||||||
|
cb,
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
exports.down = function (db, cb) {
|
||||||
|
db.runSql('ALTER TABLE api_tokens DROP COLUMN metadata;', cb);
|
||||||
|
};
|
Loading…
Reference in New Issue
Block a user