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:
parent
91a4de2ae7
commit
743ed33ab3
3 changed files with 36 additions and 2 deletions
|
@ -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;
|
|
@ -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'))
|
||||
);
|
||||
|
|
|
@ -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'))
|
||||
);
|
||||
|
||||
|
|
Loading…
Reference in a new issue