diff --git a/src/migrations/20240823091442-normalize-token-types.js b/src/migrations/20240823091442-normalize-token-types.js new file mode 100644 index 000000000000..12e7b31af423 --- /dev/null +++ b/src/migrations/20240823091442-normalize-token-types.js @@ -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); +};