diff --git a/packages/schemas/alterations/next-1673465463-ac-scope-name.ts b/packages/schemas/alterations/next-1673465463-ac-scope-name.ts new file mode 100644 index 000000000..49cbef454 --- /dev/null +++ b/packages/schemas/alterations/next-1673465463-ac-scope-name.ts @@ -0,0 +1,22 @@ +import { sql } from 'slonik'; + +import type { AlterationScript } from '../lib/types/alteration.js'; + +const newScopeName = 'management-api:default'; +const oldScopeName = 'default'; +const recordId = 'management-api-scope'; + +const alteration: AlterationScript = { + up: async (pool) => { + await pool.query(sql` + update scopes set name = ${newScopeName} where id = ${recordId} + `); + }, + down: async (pool) => { + await pool.query(sql` + update scopes set name = ${oldScopeName} where id = ${recordId} + `); + }, +}; + +export default alteration; diff --git a/packages/schemas/src/seeds/scope.ts b/packages/schemas/src/seeds/scope.ts index 8ae8be430..7eb942d37 100644 --- a/packages/schemas/src/seeds/scope.ts +++ b/packages/schemas/src/seeds/scope.ts @@ -5,7 +5,7 @@ export const managementResourceScopeId = 'management-api-scope'; export const managementResourceScope: Readonly = Object.freeze({ id: managementResourceScopeId, - name: 'default', + name: 'management-api:default', description: 'Default scope for management API', resourceId: managementResourceId, });