1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-22 19:07:54 +01:00
unleash.unleash/src/migrations/20210921105032-client-api-tokens-default.js
Ivar Conradi Østhus 4b7e1f4a81
feat: rename :global: env to "default" (#947)
Our testing and internal validation has proven that
the :global: environment concept confuses people more
than the problems it solves. We have thus decided to
group all configuration that was created before the
environment concept was introduced in to the "default
environment. This would still make everything work
as before in addition to introducing the env concept.

Co-authored-by: Christopher Kolstad <chriswk@getunleash.ai>
2021-09-24 13:55:00 +02:00

21 lines
457 B
JavaScript

'use strict';
exports.up = function (db, cb) {
db.runSql(
`
UPDATE api_tokens SET environment = 'default' WHERE environment = ':global:';
UPDATE api_tokens SET environment = 'default' WHERE type='client' AND environment is null;
`,
cb,
);
};
exports.down = function (db, cb) {
db.runSql(
`
UPDATE api_tokens SET environment = null WHERE type='client' AND environment = 'default';
`,
cb,
);
};