2023-01-19 20:27:01 +08:00
|
|
|
/* init_order = 1 */
|
|
|
|
|
2022-09-21 13:06:56 +08:00
|
|
|
create type application_type as enum ('Native', 'SPA', 'Traditional', 'MachineToMachine');
|
2021-08-10 17:21:34 +08:00
|
|
|
|
|
|
|
create table applications (
|
2023-01-19 20:27:01 +08:00
|
|
|
tenant_id varchar(21) not null
|
|
|
|
references tenants (id) on update cascade on delete cascade,
|
2022-04-18 15:27:58 +08:00
|
|
|
id varchar(21) not null,
|
2021-08-10 17:21:34 +08:00
|
|
|
name varchar(256) not null,
|
2022-08-02 16:18:50 +08:00
|
|
|
secret varchar(64) not null,
|
2022-01-11 11:58:58 +08:00
|
|
|
description text,
|
2021-08-10 17:21:34 +08:00
|
|
|
type application_type not null,
|
|
|
|
oidc_client_metadata jsonb /* @use OidcClientMetadata */ not null,
|
2022-01-13 14:15:13 +08:00
|
|
|
custom_client_metadata jsonb /* @use CustomClientMetadata */ not null default '{}'::jsonb,
|
2021-08-18 16:36:52 +08:00
|
|
|
created_at timestamptz not null default(now()),
|
2021-08-10 17:21:34 +08:00
|
|
|
primary key (id)
|
|
|
|
);
|
2023-01-19 20:27:01 +08:00
|
|
|
|
|
|
|
create index applications__id
|
2023-01-28 19:26:29 +08:00
|
|
|
on applications (tenant_id, id);
|