The Solo Mom Project database schema
Imported Markdown source from DOCS/database/schema-overview.md.
Source file
DOCS/database/schema-overview.md
Markdown73 lines
---title: Schema Overviewdescription: Primary relational model for auth, products, taxonomy, claims, contacts, and blogstatus: evolvinglastUpdated: "2026-03-23 12:18 ET (America/New_York)"owner: Engineering---# Schema Overview## Definition File- `db/neon/schema.ts`## Core Table Groups### Auth (Better Auth)- `user`- `session`- `account`- `verification`### App Profile and Products- `users` (app profile, includes `is_admin`)- `products`- `bookmarks`- `product_views`- `card_backgrounds`### Taxonomy- `taxonomy_terms`- `taxonomy_synonyms`- `product_taxonomy`### Claims and Moderation- `product_claims`- `product_edit_proposals`### Submissions- `product_submissions`### Contact Enrichment- `resource_contacts`### Taxonomy Suggestion Runs- `taxonomy_suggestion_runs`- `taxonomy_suggestions`- `taxonomy_suggestion_actions`### Blog (migration `0116`)- `blog_posts` — post content, status lifecycle, SEO fields, cover image- `blog_tags` — tag name/slug/description- `blog_post_tags` — many-to-many bridge with composite PK `(post_id, tag_id)`### Editorial Corpus (migration `0118`)- `editorial_sources` — one row per persisted corpus source set, such as a WhatsApp export bundle- `editorial_source_threads` — per-chat thread records with counts and non-identifying source metadata- `editorial_source_items` — redacted message/system-event records ready for downstream annotation and retrieval work- `editorial_media_artifacts` — metadata-only attachment records and future derived-artifact lane- `editorial_ingestion_runs` — operator-run history for analyze/manifest/redact/persist workflows### Editorial Retrieval Layer (migration `0119`)- `editorial_chunks` — contiguous retrieval windows derived from persisted source items- `editorial_observations` — typed retrieval annotations linked to chunk/item evidence- `editorial_entities` — normalized entities derived from recommendation observations and linked evidence keysSee `DOCS/features/blog.md` for full schema details.## Notes- Legacy categorization columns still exist in `products` (`categories`, `labels`, `tags`).- Hierarchical taxonomy links are represented via `product_taxonomy`.- Enrichment audit flags are stored in `products.enrichment_meta`.- Editorial corpus tables intentionally store redacted working-corpus records and ingestion metadata, not raw WhatsApp source text or raw chat/member labels.- Retrieval tables are additive overlays on the redacted corpus and are designed for internal editorial intelligence and downstream brief/draft grounding.