mirror of
https://github.com/Unleash/unleash.git
synced 2025-03-09 00:18:26 +01:00
fix: add migration to normalize api token types (#7974)
Adds a migration to normalize api token types already in the database, to remove any weird casing issues as currently demonstrated on sandbox  This is a companion piece to #7972
This commit is contained in:
parent
1f3cc3917e
commit
9af42b3565
24
src/migrations/20240823091442-normalize-token-types.js
Normal file
24
src/migrations/20240823091442-normalize-token-types.js
Normal file
@ -0,0 +1,24 @@
|
||||
'use strict';
|
||||
|
||||
exports.up = function (db, cb) {
|
||||
db.runSql(
|
||||
`
|
||||
UPDATE api_tokens
|
||||
SET type = 'client'
|
||||
WHERE type = 'CLIENT';
|
||||
|
||||
UPDATE api_tokens
|
||||
SET type = 'admin'
|
||||
WHERE type = 'ADMIN';
|
||||
|
||||
UPDATE api_tokens
|
||||
SET type = 'frontend'
|
||||
WHERE type = 'FRONTEND';
|
||||
`,
|
||||
cb,
|
||||
);
|
||||
};
|
||||
|
||||
exports.down = function (db, cb) {
|
||||
db.runSql(``, cb);
|
||||
};
|
Loading…
Reference in New Issue
Block a user