2021-06-22 11:07:51 -05:00
|
|
|
create table oidc_model_instances (
|
|
|
|
model_name varchar(64) not null,
|
|
|
|
id varchar(128) not null,
|
2021-07-04 08:17:55 -05:00
|
|
|
payload jsonb /* @use OidcModelInstancePayload */ not null,
|
2021-08-18 03:36:52 -05:00
|
|
|
expires_at timestamptz not null,
|
|
|
|
consumed_at timestamptz,
|
2021-06-22 11:07:51 -05:00
|
|
|
primary key (model_name, id)
|
|
|
|
);
|
|
|
|
|
2021-07-04 08:17:55 -05:00
|
|
|
create index oidc_model_instances__model_name_payload_user_code
|
2021-06-22 11:07:51 -05:00
|
|
|
on oidc_model_instances (
|
|
|
|
model_name,
|
2021-07-04 08:17:55 -05:00
|
|
|
(payload->>'userCode')
|
2021-06-22 11:07:51 -05:00
|
|
|
);
|
|
|
|
|
2021-07-04 08:17:55 -05:00
|
|
|
create index oidc_model_instances__model_name_payload_uid
|
2021-06-22 11:07:51 -05:00
|
|
|
on oidc_model_instances (
|
|
|
|
model_name,
|
2021-07-04 08:17:55 -05:00
|
|
|
(payload->>'uid')
|
2021-06-22 11:07:51 -05:00
|
|
|
);
|
|
|
|
|
2021-07-04 08:17:55 -05:00
|
|
|
create index oidc_model_instances__model_name_payload_grant_id
|
2021-06-22 11:07:51 -05:00
|
|
|
on oidc_model_instances (
|
|
|
|
model_name,
|
2021-07-04 08:17:55 -05:00
|
|
|
(payload->>'grantId')
|
2021-06-22 11:07:51 -05:00
|
|
|
);
|