Bind credential pins to immutable grants
This commit is contained in:
parent
9a305cad46
commit
d12543d730
1 changed files with 278 additions and 38 deletions
|
|
@ -24,13 +24,24 @@ CREATE TABLE execution_grants (
|
|||
CONSTRAINT execution_grants_credential_check CHECK (
|
||||
(credential_id IS NULL) = (credential_version_id IS NULL)
|
||||
),
|
||||
CONSTRAINT execution_grants_id_status_unique UNIQUE (grant_id, status)
|
||||
CONSTRAINT execution_grants_authority_tuple_unique UNIQUE (
|
||||
grant_id,
|
||||
status,
|
||||
credential_id,
|
||||
credential_version_id
|
||||
)
|
||||
);
|
||||
|
||||
ALTER TABLE execution_grant_credential_pins
|
||||
ADD CONSTRAINT execution_grant_pins_authoritative_grant_fk
|
||||
FOREIGN KEY (grant_id, status)
|
||||
REFERENCES execution_grants (grant_id, status)
|
||||
FOREIGN KEY (grant_id, status, credential_id, version_id)
|
||||
REFERENCES execution_grants (
|
||||
grant_id,
|
||||
status,
|
||||
credential_id,
|
||||
credential_version_id
|
||||
)
|
||||
MATCH FULL
|
||||
DEFERRABLE INITIALLY DEFERRED;
|
||||
|
||||
CREATE TABLE jobs (
|
||||
|
|
|
|||
Loading…
Reference in a new issue