Skip to content

Post

reference
1 min readUpdated

Kind: Database Model

Source: atloria-monorepo/apps/parser-orchestrator/test/fixtures/sample-projects/fullstack-nextjs-nestjs/backend/prisma/schema.prisma

Blog post model

Fields

FieldTypeRequiredKey
idStringPK
titleString
contentString
publishedBoolean
publishedAtDateTime-
authorIdString
createdAtDateTime
updatedAtDateTime

Diagram

mermaid
erDiagram
    Post {
        id String [PK]
        title String
        content String
        published Boolean
        publishedAt DateTime?
        authorId String
        createdAt DateTime
        updatedAt DateTime
    }
    Post ||--|| User : "authorId"
    Post ||--}o Comment : ""
    Post ||--}o Like : ""
    Post ||--}o Tag : ""

Relationships

  • BELONGS_TO → User
  • HAS_MANY → Comment
  • HAS_MANY → Like
  • HAS_MANY → Tag

Referenced By

  • User (HAS_MANY)
  • Comment (BELONGS_TO)
  • Like (BELONGS_TO)
  • Tag (HAS_MANY)

Was this page helpful?

Download as PDF