[2.9] catalog.elitigation_artifact #26

Closed
opened 2026-06-13 23:54:29 +02:00 by dernbu · 0 comments
Owner

Parent

#2 — depends on [2.5]

Schema

CREATE TABLE catalog.elitigation_artifact (
  id                 bigint GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
  source_judgment_id bigint NOT NULL REFERENCES catalog.elitigation_judgment,
  kind               text   NOT NULL CHECK (kind IN (raw_html, judgment_html, sanitized_html, pdf)),
  rendition_key      text   NOT NULL,
  rendition_type     text   NULL,
  source_uri         text   NULL,
  is_selected        boolean NOT NULL DEFAULT false,
  content            bytea  NOT NULL,
  content_type       text   NOT NULL,
  sha256             bytea  NOT NULL,
  size_bytes         bigint NOT NULL,
  source_url         text   NULL,
  fetched_at         timestamptz NOT NULL,
  UNIQUE (source_judgment_id, kind, rendition_key)
);

Rendition keys: detail-page → detail-page, judgment → judgment, PDF → official-pdf.

Done when

  • kind CHECK constrains to 4 allowed values
  • Composite UNIQUE enforced
## Parent #2 — depends on [2.5] ## Schema ```sql CREATE TABLE catalog.elitigation_artifact ( id bigint GENERATED ALWAYS AS IDENTITY PRIMARY KEY, source_judgment_id bigint NOT NULL REFERENCES catalog.elitigation_judgment, kind text NOT NULL CHECK (kind IN (raw_html, judgment_html, sanitized_html, pdf)), rendition_key text NOT NULL, rendition_type text NULL, source_uri text NULL, is_selected boolean NOT NULL DEFAULT false, content bytea NOT NULL, content_type text NOT NULL, sha256 bytea NOT NULL, size_bytes bigint NOT NULL, source_url text NULL, fetched_at timestamptz NOT NULL, UNIQUE (source_judgment_id, kind, rendition_key) ); ``` **Rendition keys:** detail-page → `detail-page`, judgment → `judgment`, PDF → `official-pdf`. ## Done when - `kind` CHECK constrains to 4 allowed values - Composite UNIQUE enforced
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
dernbu/lawnet-scraper#26
No description provided.