Skip to content
This repository has been archived by the owner on Dec 17, 2024. It is now read-only.

Restrict proofs table with UNIQUE(parent, prover) #35

Merged
merged 1 commit into from
Jan 12, 2024
Merged

Conversation

tuommaki
Copy link
Contributor

Currently Programs are unique within Workflow and therefore it's impossible to have same parent and prover hashes for multiple proofs.

Currently `Program`s are unique within `Workflow` and therefore it's
impossible to have same `parent` and `prover` hashes for multiple
proofs.
@tuommaki tuommaki self-assigned this Jan 12, 2024
@@ -79,6 +79,7 @@ CREATE TABLE proof (
parent VARCHAR(64) NOT NULL,
prover VARCHAR(64),
proof BYTEA NOT NULL,
UNIQUE(parent, prover),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding seat belts when discovering pitfalls 😬

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, and I think it helps postgres to optimize the query.

@tuommaki tuommaki requested a review from musitdev January 12, 2024 13:06
@tuommaki tuommaki merged commit 07db03f into proto Jan 12, 2024
4 checks passed
@tuommaki tuommaki deleted the restrict-proofs branch January 12, 2024 14:57
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants