0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2024-12-16 20:26:19 -05:00

chore: rename SAML application secrets/configs constraints (#6840)

This commit is contained in:
Darcy Ye 2024-11-29 14:11:46 +08:00 committed by GitHub
parent 91a4de2ae7
commit 743ed33ab3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 36 additions and 2 deletions

View file

@ -0,0 +1,34 @@
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 saml_application_configs
rename constraint application_type
to saml_application_configs__application_type;
`);
await pool.query(sql`
alter table saml_application_secrets
rename constraint application_type
to saml_application_secrets__application_type;
`);
},
down: async (pool) => {
await pool.query(sql`
alter table saml_application_configs
rename constraint saml_application_configs__application_type
to application_type;
`);
await pool.query(sql`
alter table saml_application_secrets
rename constraint saml_application_secrets__application_type
to application_type;
`);
},
};
export default alteration;

View file

@ -10,6 +10,6 @@ create table saml_application_configs (
entity_id varchar(128),
acs_url jsonb /* @use SamlAcsUrl */,
primary key (tenant_id, application_id),
constraint application_type
constraint saml_application_configs__application_type
check (check_application_type(application_id, 'SAML'))
);

View file

@ -12,7 +12,7 @@ create table saml_application_secrets (
expires_at timestamptz not null,
active boolean not null,
primary key (tenant_id, application_id, id),
constraint application_type
constraint saml_application_secrets__application_type
check (check_application_type(application_id, 'SAML'))
);