mirror of
https://github.com/block/buzz.git
synced 2026-11-08 18:31:56 +00:00
12 lines
419 B
SQL
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);
|