mirror of
https://github.com/logto-io/logto.git
synced 2024-12-16 20:26:19 -05:00
559331d51e
* refactor(core,schemas): make the jwt customizer script field mandatory make the jwt customizer script field mandatory * fix(schemas): fix the alteration script fix the alteration script * fix(schemas): fix ut fix ut
23 lines
754 B
TypeScript
23 lines
754 B
TypeScript
import { sql } from '@silverhand/slonik';
|
|
|
|
import type { AlterationScript } from '../lib/types/alteration.js';
|
|
|
|
const alteration: AlterationScript = {
|
|
// We are making the jwt-customizer script field mandatory
|
|
// Delete the records in logto_configs where key is jwt.accessToken or jwt.clientCredentials and value jsonb's script field is undefined
|
|
up: async (pool) => {
|
|
await pool.query(
|
|
sql`
|
|
delete from logto_configs
|
|
where key in ('jwt.accessToken', 'jwt.clientCredentials')
|
|
and value->>'script' is null
|
|
`
|
|
);
|
|
},
|
|
down: async () => {
|
|
// No down script available, this is a non-reversible operation
|
|
// It is fine since we have not released this feature yet
|
|
},
|
|
};
|
|
|
|
export default alteration;
|