Skip to content

Commit

Permalink
feat(pollux): Add migrations needed for JWT revocation (#778)
Browse files Browse the repository at this point in the history
Signed-off-by: Shota Jolbordi <shota.jolbordi@iohk.io>
  • Loading branch information
shotexa authored Nov 9, 2023
1 parent 03d43c9 commit 471956e
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ megalinter-reports/
.vscode
.bloop
.bsp
.jvmopts
.metals
**/project/metals.sbt
target
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
CREATE TYPE public.enum_credential_status_list_purpose AS ENUM (
'Revocation',
'Suspension');


CREATE TABLE public.credential_status_lists
(
id UUID PRIMARY KEY default gen_random_uuid(),
wallet_id UUID NOT NULL,
issuer VARCHAR NOT NULL,
issued TIMESTAMP WITH TIME ZONE NOT NULL,
purpose public.enum_credential_status_list_purpose NOT NULL,
encoded_list TEXT NOT NULL,
proof JSON NOT NULL,
created_at TIMESTAMP WITH TIME ZONE NOT NULL default now(),
updated_at TIMESTAMP WITH TIME ZONE NOT NULL default now()
);

CREATE INDEX credential_status_lists_wallet_id_index ON public.credential_revocation_status_lists (wallet_id);

CREATE TABLE public.credentials_in_status_list
(
id UUID PRIMARY KEY default gen_random_uuid(),
issue_credential_record_id UUID NOT NULL,
credential_status_list_id UUID NOT NULL,
status_list_index INTEGER NOT NULL,
-- is revoked or suspended
is_canceled BOOLEAN NOT NULL default false,
created_at TIMESTAMP WITH TIME ZONE NOT NULL default now(),
updated_at TIMESTAMP WITH TIME ZONE NOT NULL default now(),

CONSTRAINT issue_credential_record_id_fkey FOREIGN KEY (issue_credential_record_id) REFERENCES public.issue_credential_records (id) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT credential_status_list_id_fkey FOREIGN KEY (credential_status_list_id) REFERENCES public.credential_status_lists (id) ON DELETE CASCADE ON UPDATE CASCADE
);

0 comments on commit 471956e

Please sign in to comment.