0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2024-12-30 20:33:54 -05:00
logto/packages/schemas/alterations/1.21.0-1728887713-add-client-idp-initiated-auth-callback-uri-columns.ts

41 lines
1.4 KiB
TypeScript
Raw Normal View History

import { sql } from '@silverhand/slonik';
import type { AlterationScript } from '../lib/types/alteration.js';
const alteration: AlterationScript = {
up: async (pool) => {
await pool.query(sql`
alter table sso_connector_idp_initiated_auth_configs
add column client_idp_initiated_auth_callback_uri text;
alter table sso_connector_idp_initiated_auth_configs
add column auto_send_authorization_request boolean not null default false;
alter table sso_connector_idp_initiated_auth_configs
drop constraint application_type;
alter table sso_connector_idp_initiated_auth_configs
add constraint application_type
check (check_application_type(default_application_id, 'Traditional', 'SPA'));
`);
},
down: async (pool) => {
await pool.query(sql`
alter table sso_connector_idp_initiated_auth_configs
drop constraint application_type;
alter table sso_connector_idp_initiated_auth_configs
drop column client_idp_initiated_auth_callback_uri;
alter table sso_connector_idp_initiated_auth_configs
drop column auto_send_authorization_request;
alter table sso_connector_idp_initiated_auth_configs
add constraint application_type
check (check_application_type(default_application_id, 'Traditional'));
`);
},
};
export default alteration;