From 3636fa5afdea83ea030540be9220b3454e33636a Mon Sep 17 00:00:00 2001 From: Ben Stull Date: Sun, 7 Jun 2026 17:33:11 -0700 Subject: [PATCH] =?UTF-8?q?feat(slice3):=20migration=20034=20=E2=80=94=20c?= =?UTF-8?q?ached=5Frfcs.meta=5Fjson=20for=20facet=20values=20(=C2=A722.4a)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/migrations/034_cached_rfc_meta.sql | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 backend/migrations/034_cached_rfc_meta.sql diff --git a/backend/migrations/034_cached_rfc_meta.sql b/backend/migrations/034_cached_rfc_meta.sql new file mode 100644 index 0000000..0122aab --- /dev/null +++ b/backend/migrations/034_cached_rfc_meta.sql @@ -0,0 +1,12 @@ +-- §22.4a SLICE-3 — configurable collection metadata: cache per-entry values. +-- +-- Faceted filtering (§5.1) needs each entry's metadata values (priority, custom +-- enum/tags fields) to compute facet counts and honour filter params. Today the +-- mirror keeps only `tags_json` + the lifecycle columns and drops `Entry.extra`, +-- so a declared field's values are unrecoverable. This column persists the full +-- per-entry metadata mapping (`metadata.metadata_dict(entry)`, known keys + +-- extra, never the body) as JSON, so `app/facets.py` can read any declared +-- field uniformly. Additive + nullable — no rebuild. NULL = not yet re-ingested +-- (the reconciler/webhook fills it on the next sweep) → that entry contributes +-- no facet values until then. SLICE-4/5 edit panels read the same column. +ALTER TABLE cached_rfcs ADD COLUMN meta_json TEXT;