Files
buzz/schema/tables/public/artifact_revisions.sql
Daniel Rouleau cdfee769b3 fix(relay): bound snapshot reads and deletion
Signed-off-by: Daniel Rouleau <drouleau@squareup.com>
2026-10-21 13:31:32 -07:00

12 lines
419 B
SQL

-- Every accepted revision ID, so replays stay idempotent after redaction or
-- retention.
CREATE TABLE artifact_revisions (
community_id UUID NOT NULL REFERENCES communities(id),
event_id BYTEA NOT NULL CHECK (length(event_id) = 32),
artifact_id UUID NOT NULL,
PRIMARY KEY (community_id, event_id)
);
CREATE INDEX idx_artifact_revisions_artifact
ON artifact_revisions (community_id, artifact_id);