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
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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.

CONSTRAINT fk_transaction1
FOREIGN KEY (tx)
REFERENCES transaction (hash) ON DELETE CASCADE,
Expand Down