mirror of
https://github.com/Unleash/unleash.git
synced 2024-12-22 19:07:54 +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 ![image](https://github.com/user-attachments/assets/ad14db22-114d-4de2-b952-722df9ae84a4) 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