Skip to content

CMS Database Schema

Database: cms_myeasyguideORM: Prisma 7.8 Purpose: Dedicated content management database, independent from the main API database.

Models

Post

The core content entity — replaces the API's Blog model. Supports blog posts, travel guides, and scheduled content.

FieldTypeNotes
idString (cuid, PK)
titleString?Post title
slugString (unique)URL slug
contentStringHTML/rich text content
coverImageString?
statusStringdraft, published, scheduled, or trash
scheduledAtDateTime?For scheduled publishing
publishedAtDateTime?
viewsIntDefault 0
metaTitleString?SEO title
metaDescriptionString?SEO description
metaJson?Metadata (word count, reading time, focus keyphrase)
jsonLdSchemaJson?Structured data
tagsString?Comma-separated tag names
canonicalUrlString?Canonical URL
urlHistoryString[]Previous URLs for redirects
cityHandleString?City slug for geo-tagging

Relations:

  • categoryPostCategory (optional)
  • subcategorySubCategory (optional)
  • authorAuthor (optional)
  • cityCity (optional)
  • countryCountry (optional)

PostCategory

Content categories (replaces API's BlogCategory).

FieldTypeNotes
idString (cuid, PK)
nameStringDisplay name
slugString (unique)URL slug

SubCategory

Content subcategories — new model not present in the API schema.

FieldTypeNotes
idString (cuid, PK)
nameStringDisplay name
slugString (unique)URL slug

Author

Blog authors. Note: This is a separate table from the API's Author model. Authors were migrated from the API database to the CMS database.

FieldTypeNotes
idString (cuid, PK)
usernameString (unique)
nameString?
emailString (unique)Login email
passwordStringbcrypt-hashed
bioString?
imageString?
createdAtDateTime
updatedAtDateTime

City

Cities for geo-tagging posts. Separate table from the API's City model.

FieldTypeNotes
idString (cuid, PK)
cityNameString
cityHandleString (unique)URL-safe slug
cityImageString?

Country

Countries for geo-tagging posts. New model not present in the API schema (the API had country as a string field on Blog).

FieldTypeNotes
idString (cuid, PK)
countryNameString
countryCodeString (unique)ISO country code
countryHandleString (unique)URL-safe slug

Tag

Blog tags. New model — the API stored tags as a comma-separated string.

FieldTypeNotes
idString (cuid, PK)
nameString (unique)

GenerationBatch

Tracks AI-generated blog post batches.

FieldTypeNotes
idString (cuid, PK)
batchIdString (unique)Claude batch API ID
topicsString[]Topics submitted for generation
focusString?Writing focus/angle
statusStringpending, processing, completed, or failed
errorString?Error message if failed

Schema Comparison: API vs CMS

API ModelCMS EquivalentNotes
BlogPostNew fields: status (with trash support), scheduledAt, meta, jsonLdSchema, canonicalUrl, urlHistory
BlogCategoryPostCategorySimplified — no timestamps
SubCategoryNew model, not in API
AuthorAuthorSeparate table in CMS database
CountryNew model, API used a plain string
TagNew model, API used comma-separated string
BlogGenerationImportGenerationBatchSimplified — no import/row/job hierarchy
BlogGenerationImportRowFolded into GenerationBatch
BlogGenerationJobFolded into GenerationBatch
BusinessLinkFeature removed
CityCitySeparate table in CMS database

Built with VitePress