Skip to content

Commit

Permalink
chore: credential hash unique per role
Browse files Browse the repository at this point in the history
  • Loading branch information
sanderPostma committed Sep 16, 2024
1 parent db25837 commit dee4928
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export class CreateDigitalCredential1708525189001 implements MigrationInterface
"raw_document" text NOT NULL,
"uniform_document" text NOT NULL,
"credential_id" text,
"hash" text NOT NULL UNIQUE,
"hash" text NOT NULL,
"kms_key_ref" text,
"identifier_method" text,
"issuer_correlation_type" "digital_credential_correlation_type" NOT NULL,
Expand All @@ -43,7 +43,8 @@ export class CreateDigitalCredential1708525189001 implements MigrationInterface
"valid_until" DATE,
"verified_at" DATE,
"revoked_at" DATE,
PRIMARY KEY ("id")
PRIMARY KEY ("id"),
UNIQUE ("hash", "credential_role")
)
`)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export class CreateDigitalCredential1708525189002 implements MigrationInterface
"raw_document" text NOT NULL,
"uniform_document" text NOT NULL,
"credential_id" text,
"hash" text NOT NULL UNIQUE,
"hash" text NOT NULL,
"kms_key_ref" text,
"identifier_method" text,
"issuer_correlation_type" varchar CHECK( "issuer_correlation_type" IN ('DID', 'KID', 'URL', 'X509_SAN') ) NOT NULL,
Expand All @@ -34,7 +34,8 @@ export class CreateDigitalCredential1708525189002 implements MigrationInterface
"valid_from" datetime,
"valid_until" datetime,
"verified_at" datetime,
"revoked_at" datetime
"revoked_at" datetime,
UNIQUE ("hash", "credential_role")
)
`)
}
Expand Down

0 comments on commit dee4928

Please sign in to comment.