Database
Version 1 · Initial database doc based on codebase exploration
QDG CMS — Database
No direct database access
This repository contains no direct database access of any kind — no ORM, no SQL driver, no connection string, no database config. A repo-wide search for sql|mysql|postgres|mongo|prisma|knex|sequelize|typeorm|database across src/**/*.ts(x) only turns up developer comments annotating what the backend persists — not actual database code.
All persistence is mediated by two external systems:
- QDG CMS API (
.NET 9 Web API, separate repo — see theqdg-cms-apiKB project) — owns the actual relational database and all reads/writes to it. This frontend only ever calls its REST endpoints (see API Documents). - Wasabi (S3-compatible object storage) — stores raw media file bytes (photos, videos, and photo size variants) directly, via presigned URLs. The CMS API never touches these bytes; it only stores the resulting object keys.
For authoritative schema documentation, consult the qdg-cms-api project's database docs. What follows is the schema shape inferred only from inline comments in this frontend repo, useful as context but not authoritative.
Inferred backend tables (from code comments)
Referenced by table name in comments across src/pages/CreateStoryPage.tsx, src/services/api/imageService.ts, src/services/api/storyService.ts, src/types/story.ts, and src/utils/storyMappings.ts:
photogallery.tblphotos— legacy photo/media table (predates theqdgmedia schema this app now targets viamediaService).tblcms— story/content records.tblcms_site— site lookup (used for story classification, linked to/Lookup/sites).tblcms_newstype— news-type lookup, scoped per site (/Lookup/news-types?siteIds=).qdb.races— race reference data, joined against horses/jockeys/trainers/courses (/Lookup/horses,/Lookup/trainers,/Lookup/jockeys,/Lookup/courses,/Lookup/races?courseId=), consistent with the wider QDG racing-data platform (seeqds-router,titan-command).
These names suggest the backend spans at least two schema generations: an older photogallery/tblcms* naming convention and a newer qdg/Media naming convention that the current mediaService/storyService API surface targets — consistent with the "legacy Appsmith to React" migration this app is part of (see Project Architecture).
Media object storage shape
Not a database, but the closest thing this frontend directly shapes: each photo media record carries up to 5 independently-stored size-variant object keys — smallObjectKey, mediumObjectKey, hdObjectKey, hiresObjectKey, largeObjectKey (src/types/media.ts) — pointing at objects in Wasabi. Videos store a single object key with no variants. See API Documents for the upload/registration flow that populates these keys.
Recommendation
Treat this page as a pointer, not a source of truth. Any real schema change, migration, or table documentation belongs in the qdg-cms-api KB project, since that service owns the database.