Skip to content

Commit

Permalink
feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
reinkrul committed Nov 29, 2023
1 parent 3a759fc commit 2467cc7
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions storage/sql_migrations/2_discoveryservice.up.sql
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
-- discovery contains the known discovery services and the highest timestamp
create table discovery_service
(
id varchar(36) not null primary key,
lamport_timestamp integer not null
-- id is the unique identifier for the service. It comes from the service definition.
id varchar(200) not null primary key,
lamport_timestamp integer not null
);

-- discovery_presentation contains the presentations of the discovery services
Expand All @@ -18,13 +19,16 @@ create table discovery_presentation
unique (service_id, credential_subject_id),
constraint fk_discovery_presentation_service_id foreign key (service_id) references discovery_service (id) on delete cascade
);
-- index for the presentation_expiration column, used by prune()
create index idx_discovery_presentation_expiration on discovery_presentation (presentation_expiration);

-- discovery_credential is a credential in a presentation of the discovery service.
-- We could do without the table, but having it allows to have a normalized index for credential properties that appear on every credential.
-- Then we don't need rows in the properties table for them (having a column for those is faster than having a row in the properties table which needs to be joined).
create table discovery_credential
(
id varchar(36) not null primary key,
-- presentation_id is NOT the ID of the presentation (VerifiablePresentation.ID), but refers to the presentation record in the discovery_presentation table.
presentation_id varchar(36) not null,
credential_id varchar not null,
credential_issuer varchar not null,
Expand Down

0 comments on commit 2467cc7

Please sign in to comment.