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:
parent
e1c11a4da6
commit
9ec3a8fcb7
2 changed files with 23 additions and 1 deletions
|
@ -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;
|
|
@ -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,
|
||||
});
|
||||
|
|
Loading…
Add table
Reference in a new issue