0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2025-01-20 21:32:31 -05:00

fix(schemas): modify management api default scope name (#2920)

This commit is contained in:
wangsijie 2023-01-12 16:33:14 +08:00 committed by GitHub
parent e1c11a4da6
commit 9ec3a8fcb7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 1 deletions

View file

@ -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;

View file

@ -5,7 +5,7 @@ export const managementResourceScopeId = 'management-api-scope';
export const managementResourceScope: Readonly<CreateScope> = Object.freeze({
id: managementResourceScopeId,
name: 'default',
name: 'management-api:default',
description: 'Default scope for management API',
resourceId: managementResourceId,
});