Skip to content

Commit eba2843

Browse files
authored
Merge pull request #7732 from logto-io/charles-log-12103-schemas-and-db-alteration
feat(schemas): add organization level custom css support
2 parents 28806bb + 6cd7ea9 commit eba2843

File tree

3 files changed

+18
-0
lines changed

3 files changed

+18
-0
lines changed

packages/integration-tests/src/tests/api/organization/organization.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,11 +119,13 @@ describe('organization APIs', () => {
119119
const organization = await organizationApi.update(createdOrganization.id, {
120120
name: 'test2',
121121
description: 'test description.',
122+
customCss: 'test css',
122123
});
123124
expect(organization).toStrictEqual({
124125
...createdOrganization,
125126
name: 'test2',
126127
description: 'test description.',
128+
customCss: 'test css',
127129
});
128130
});
129131

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { sql } from '@silverhand/slonik';
2+
3+
import type { AlterationScript } from '../lib/types/alteration.js';
4+
5+
const alteration: AlterationScript = {
6+
up: async (pool) => {
7+
await pool.query(sql`alter table organizations add column custom_css text;`);
8+
},
9+
down: async (pool) => {
10+
await pool.query(sql`alter table organizations drop column custom_css;`);
11+
},
12+
};
13+
14+
export default alteration;

packages/schemas/tables/organizations.sql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ create table organizations (
1212
description varchar(256),
1313
/** Additional data associated with the organization. */
1414
custom_data jsonb /* @use JsonObject */ not null default '{}'::jsonb,
15+
/** The custom CSS of the organization. */
16+
custom_css text,
1517
/** Whether multi-factor authentication configuration is required for the members of the organization. */
1618
is_mfa_required boolean not null default false,
1719
/** The organization's branding configuration. */

0 commit comments

Comments
 (0)