Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: rename SAML application secrets/configs constraints #6840

Merged
merged 1 commit into from
Nov 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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;
2 changes: 1 addition & 1 deletion packages/schemas/tables/saml_application_configs.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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'))
);
2 changes: 1 addition & 1 deletion packages/schemas/tables/saml_application_secrets.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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'))
);

Expand Down
Loading