Skip to content
The Chat Archive
claude-sonnet-4-20250514· Anthropic LMArena Human Preference 140K

complete the following prisma models // This is your Prisma schema file, // learn more…

  1. User

    complete the following prisma models // This is your Prisma schema file, // learn more about it in the docs: https://pris.ly/d/prisma-schema

    generator client { provider = "prisma-client-js" output = "../generated/prisma" }

    datasource db { provider = "sqlite" url = env("DATABASE_URL") }

    // ================ model Account { // --- Core Identification --- id String @id @default(ulid())

    // --- Timestamps --- createdAt DateTime @default(now()) updatedAt DateTime @updatedAt

    // --- Virtual Relationships --- personalAccount PersonalAccount? professionalAccount ProfessionalAccount? businessAccount BusinessAccount? wallet Wallet? memberships Membership[] }

    model PersonalAccount { // --- Core Identification --- id String @id @default(ulid())

    // --- Relationships --- account Account @relation(fields: [accountId], references: [id]) accountId String @unique

    // --- Timestamps --- createdAt DateTime @default(now()) updatedAt DateTime @updatedAt }

    model ProfessionalAccount { // --- Core Identification --- id String @id @default(ulid())

    // --- Relationships --- account Account @relation(fields: [accountId], references: [id]) accountId String @unique

    // --- Timestamps --- createdAt DateTime @default(now()) updatedAt DateTime @updatedAt }

    model BusinessAccount { // --- Core Identification --- id String @id @default(ulid())

    // --- Relationships --- account Account @relation(fields: [accountId], references: [id]) accountId String @unique

    // --- Timestamps --- createdAt DateTime @default(now()) updatedAt DateTime @updatedAt }

    // ================ model Wallet { // --- Core Identification --- id String @id @default(ulid())

    // --- Relationships --- account Account @relation(fields: [accountId], references: [id]) accountId String @unique

    // --- Timestamps --- createdAt DateTime @default(now()) updatedAt DateTime @updatedAt }

    // ================ model Group { // --- Core Identification --- id String @id @default(ulid())

    // --- Timestamps --- createdAt DateTime @default(now()) updatedAt DateTime @updatedAt

    // --- Virtual Relationships --- memberships Membership[] }

    model Membership { // --- Core Identification --- id String @id @default(ulid())

    // --- Relationships --- group Group @relation(fields: [groupId], references: [id]) groupId String

    account Account @relation(fields: [accountId], references: [id]) accountId String

    // --- Timestamps --- createdAt DateTime @default(now()) updatedAt DateTime @updatedAt

    @@unique([groupId, accountId]) }

    // ================ model Page { // --- Core Identification --- id String @id @default(ulid())

    // --- Timestamps --- createdAt DateTime @default(now()) updatedAt DateTime @updatedAt

    // --- Virtual Relationships --- schoolPage SchoolPage? drivingSchoolPage DrivingSchoolPage? reviewCenterPage ReviewCenterPage? }

    model SchoolPage { // --- Core Identification --- id String @id @default(ulid())

    // --- Relationships --- page Page @relation(fields: [pageId], references: [id]) pageId String @unique

    // --- Timestamps --- createdAt DateTime @default(now()) updatedAt DateTime @updatedAt }

    model DrivingSchoolPage { // --- Core Identification --- id String @id @default(ulid())

    // --- Relationships --- page Page @relation(fields: [pageId], references: [id]) pageId String @unique

    // --- Timestamps --- createdAt DateTime @default(now()) updatedAt DateTime @updatedAt }

    model ReviewCenterPage { // --- Core Identification --- id String @id @default(ulid())

    // --- Relationships --- page Page @relation(fields: [pageId], references: [id]) pageId String @unique

    // --- Timestamps --- createdAt DateTime @default(now()) updatedAt DateTime @updatedAt }

    // ================ model Post { // --- Core Identification --- id String @id @default(ulid())

    // --- Timestamps --- createdAt DateTime @default(now()) updatedAt DateTime @updatedAt

    // --- Virtual Relationships --- deletedPost DeletedPost? textPost TextPost? linkPost LinkPost? pollPost PollPost? questionPost QuestionPost? jobPost JobPost? comments Comment[] reports Report[] reactions Reaction[] responses Response[] }

    model DeletedPost { // --- Core Identification --- id String @id @default(ulid())

    // --- Relationships --- post Post @relation(fields: [postId], references: [id]) postId String @unique

    // --- Timestamps --- createdAt DateTime @default(now()) updatedAt DateTime @updatedAt }

    model TextPost { // --- Core Identification --- id String @id @default(ulid())

    // --- Relationships --- post Post @relation(fields: [postId], references: [id]) postId String @unique

    // --- Timestamps --- createdAt DateTime @default(now()) updatedAt DateTime @updatedAt }

    model LinkPost { // --- Core Identification --- id String @id @default(ulid())

    // --- Relationships --- post Post @relation(fields: [postId], references: [id]) postId String @unique

    // --- Timestamps --- createdAt DateTime @default(now()) updatedAt DateTime @updatedAt }

    model PollPost { // --- Core Identification --- id String @id @default(ulid())

    // --- Relationships --- post Post @relation(fields: [postId], references: [id]) postId String @unique

    // --- Timestamps --- createdAt DateTime @default(now()) updatedAt DateTime @updatedAt }

    model QuestionPost { // --- Core Identification --- id String @id @default(ulid())

    // --- Relationships --- post Post @relation(fields: [postId], references: [id]) postId String @unique

    // --- Timestamps --- createdAt DateTime @default(now()) updatedAt DateTime @updatedAt }

    model JobPost { // --- Core Identification --- id String @id @default(ulid())

    // --- Relationships --- post Post @relation(fields: [postId], references: [id]) postId String @unique

    // --- Timestamps --- createdAt DateTime @default(now()) updatedAt DateTime @updatedAt }

    // ================ model Comment { // --- Core Identification --- id String @id @default(ulid())

    // --- Relationships --- post Post @relation(fields: [postId], references: [id]) postId String @unique

    // --- Timestamps --- createdAt DateTime @default(now()) updatedAt DateTime @updatedAt

    // --- Virtual Relationships --- replies Reply[] }

    model Reply { // --- Core Identification --- id String @id @default(ulid())

    // --- Relationships --- comment Comment @relation(fields: [commentId], references: [id]) commentId String @unique

    // --- Timestamps --- createdAt DateTime @default(now()) updatedAt DateTime @updatedAt }

    // ================ model Attachment { id String @id @default(ulid()) }

    model Topic { id String @id @default(ulid()) }

    // ================ model Report { // --- Core Identification --- id String @id @default(ulid())

    // --- Relationships --- post Post @relation(fields: [postId], references: [id]) postId String @unique

    // --- Timestamps --- createdAt DateTime @default(now()) updatedAt DateTime @updatedAt }

    // ================ model Reaction { // --- Core Identification --- id String @id @default(ulid())

    // --- Relationships --- post Post @relation(fields: [postId], references: [id]) postId String @unique

    // --- Timestamps --- createdAt DateTime @default(now()) updatedAt DateTime @updatedAt }

    model Response { // --- Core Identification --- id String @id @default(ulid())

    // --- Relationships --- post Post @relation(fields: [postId], references: [id]) postId String @unique

    // --- Timestamps --- createdAt DateTime @default(now()) updatedAt DateTime @updatedAt }

    // ================ model Notification { id String @id @default(ulid())

    createdAt DateTime @default(now()) updatedAt DateTime @updatedAt }

  2. Assistant

    Here's the completed Prisma schema with all necessary fields and proper relationships:

    // This is your Prisma schema file,
    // learn more about it in the docs: https://pris.ly/d/prisma-schema
    
    generator client {
      provider = "prisma-client-js"
      output   = "../generated/prisma"
    }
    
    datasource db {
      provider = "sqlite"
      url      = env("DATABASE_URL")
    }
    
    // ================
    model Account {
      // --- Core Identification ---
      id String @id @default(ulid())
    
      // --- Account Details ---
      email    String  @unique
      username String? @unique
      status   String  @default("ACTIVE") // ACTIVE, SUSPENDED, DELETED
    
      // --- Timestamps ---
      createdAt DateTime @default(now())
      updatedAt DateTime @updatedAt
    
      // --- Virtual Relationships ---
      personalAccount     PersonalAccount?
      professionalAccount ProfessionalAccount?
      businessAccount     BusinessAccount?
      wallet              Wallet?
      memberships         Membership[]
      posts               Post[]
      comments            Comment[]
      replies             Reply[]
      reactions           Reaction[]
      reports             Report[]
      notifications       Notification[]
    }
    
    model PersonalAccount {
      // --- Core Identification ---
      id String @id @default(ulid())
    
      // --- Relationships ---
      account   Account @relation(fields: [accountId], references: [id], onDelete: Cascade)
      accountId String  @unique
    
      // --- Personal Details ---
      firstName   String
      lastName    String
      dateOfBirth DateTime?
      phoneNumber String?
      bio         String?
      avatar      String?
    
      // --- Timestamps ---
      createdAt DateTime @default(now())
      updatedAt DateTime @updatedAt
    }
    
    model ProfessionalAccount {
      // --- Core Identification ---
      id String @id @default(ulid())
    
      // --- Relationships ---
      account   Account @relation(fields: [accountId], references: [id], onDelete: Cascade)
      accountId String  @unique
    
      // --- Professional Details ---
      title           String
      company         String?
      industry        String?
      experience      Int?    // years of experience
      skills          String? // JSON array of skills
      licenseNumber   String?
      certifications  String? // JSON array of certifications
      linkedinProfile String?
      portfolio       String?
    
      // --- Timestamps ---
      createdAt DateTime @default(now())
      updatedAt DateTime @updatedAt
    }
    
    model BusinessAccount {
      // --- Core Identification ---
      id String @id @default(ulid())
    
      // --- Relationships ---
      account   Account @relation(fields: [accountId], references: [id], onDelete: Cascade)
      accountId String  @unique
    
      // --- Business Details ---
      businessName        String
      businessType        String
      industry            String
      description         String?
      address             String
      city                String
      state               String?
      country             String
      postalCode          String?
      phoneNumber         String?
      website             String?
      taxId               String?
      registrationNumber  String?
      employeeCount       Int?
      foundedYear         Int?
    
      // --- Timestamps ---
      createdAt DateTime @default(now())
      updatedAt DateTime @updatedAt
    }
    
    // ================
    model Wallet {
      // --- Core Identification ---
      id String @id @default(ulid())
    
      // --- Relationships ---
      account   Account @relation(fields: [accountId], references: [id], onDelete: Cascade)
      accountId String  @unique
    
      // --- Wallet Details ---
      balance  Decimal @default(0.00)
      currency String  @default("USD")
      status   String  @default("ACTIVE") // ACTIVE, FROZEN, SUSPENDED
    
      // --- Timestamps ---
      createdAt DateTime @default(now())
      updatedAt DateTime @updatedAt
    
      // --- Virtual Relationships ---
      transactions Transaction[]
    }
    
    model Transaction {
      // --- Core Identification ---
      id String @id @default(ulid())
    
      // --- Relationships ---
      wallet   Wallet @relation(fields: [walletId], references: [id])
      walletId String
    
      // --- Transaction Details ---
      type        String  // DEPOSIT, WITHDRAWAL, TRANSFER, PAYMENT
      amount      Decimal
      description String?
      reference   String? // external reference
      status      String  @default("PENDING") // PENDING, COMPLETED, FAILED, CANCELLED
    
      // --- Timestamps ---
      createdAt DateTime @default(now())
      updatedAt DateTime @updatedAt
    }
    
    // ================
    model Group {
      // --- Core Identification ---
      id String @id @default(ulid())
    
      // --- Group Details ---
      name        String
      description String?
      type        String  @default("PUBLIC") // PUBLIC, PRIVATE, SECRET
      avatar      String?
      coverImage  String?
      rules       String? // JSON array of rules
      tags        String? // JSON array of tags
    
      // --- Settings ---
      isActive      Boolean @default(true)
      memberLimit   Int?
      requireApproval Boolean @default(false)
    
      // --- Timestamps ---
      createdAt DateTime @default(now())
      updatedAt DateTime @updatedAt
    
      // --- Virtual Relationships ---
      memberships Membership[]
      posts       Post[]
    }
    
    model Membership {
      // --- Core Identification ---
      id String @id @default(ulid())
    
      // --- Relationships ---
      group   Group  @relation(fields: [groupId], references: [id], onDelete: Cascade)
      groupId String
    
      account   Account @relation(fields: [accountId], references: [id], onDelete: Cascade)
      accountId String
    
      // --- Membership Details ---
      role   String @default("MEMBER") // OWNER, ADMIN, MODERATOR, MEMBER
      status String @default("ACTIVE") // ACTIVE, PENDING, BANNED
    
      // --- Timestamps ---
      createdAt DateTime @default(now())
      updatedAt DateTime @updatedAt
    
      @@unique([groupId, accountId])
    }
    
    // ================
    model Page {
      // --- Core Identification ---
      id String @id @default(ulid())
    
      // --- Page Details ---
      title       String
      slug        String  @unique
      description String?
      avatar      String?
      coverImage  String?
      contactInfo String? // JSON object with contact details
      location    String?
      website     String?
      isVerified  Boolean @default(false)
      isActive    Boolean @default(true)
    
      // --- Timestamps ---
      createdAt DateTime @default(now())
      updatedAt DateTime @updatedAt
    
      // --- Virtual Relationships ---
      schoolPage        SchoolPage?
      drivingSchoolPage DrivingSchoolPage?
      reviewCenterPage  ReviewCenterPage?
      posts             Post[]
    }
    
    model SchoolPage {
      // --- Core Identification ---
      id String @id @default(ulid())
    
      // --- Relationships ---
      page   Page   @relation(fields: [pageId], references: [id], onDelete: Cascade)
      pageId String @unique
    
      // --- School Details ---
      schoolType      String // PRIMARY, SECONDARY, UNIVERSITY, COLLEGE
      principalName   String?
      studentCount    Int?
      teacherCount    Int?
      establishedYear Int?
      accreditation   String?
      programs        String? // JSON array of programs offered
      facilities      String? // JSON array of facilities
    
      // --- Timestamps ---
      createdAt DateTime @default(now())
      updatedAt DateTime @updatedAt
    }
    
    model DrivingSchoolPage {
      // --- Core Identification ---
      id String @id @default(ulid())
    
      // --- Relationships ---
      page   Page   @relation(fields: [pageId], references: [id], onDelete: Cascade)
      pageId String @unique
    
      // --- Driving School Details ---
      licenseNumber   String?
      instructorCount Int     @default(0)
      vehicleCount    Int     @default(0)
      services        String? // JSON array of services
      pricing         String? // JSON object with pricing info
      operatingHours  String? // JSON object with hours
      languages       String? // JSON array of languages supported
    
      // --- Timestamps ---
      createdAt DateTime @default(now())
      updatedAt DateTime @updatedAt
    }
    
    model ReviewCenterPage {
      // --- Core Identification ---
      id String @id @default(ulid())
    
      // --- Relationships ---
      page   Page   @relation(fields: [pageId], references: [id], onDelete: Cascade)
      pageId String @unique
    
      // --- Review Center Details ---
      subjects       String? // JSON array of subjects
      examTypes      String? // JSON array of exam types
      capacity       Int?
      rating         Float   @default(0.0)
      reviewCount    Int     @default(0)
      operatingHours String? // JSON object with hours
      facilities     String? // JSON array of facilities
    
      // --- Timestamps ---
      createdAt DateTime @default(now())
      updatedAt DateTime @updatedAt
    }
    
    // ================
    model Post {
      // --- Core Identification ---
      id String @id @default(ulid())
    
      // --- Relationships ---
      author   Account @relation(fields: [authorId], references: [id])
      authorId String
    
      group   Group?  @relation(fields: [groupId], references: [id])
      groupId String?
    
      page   Page?   @relation(fields: [pageId], references: [id])
      pageId String?
    
      // --- Post Details ---
      title     String?
      content   String?
      status    String  @default("PUBLISHED") // DRAFT, PUBLISHED, ARCHIVED, DELETED
      visibility String @default("PUBLIC") // PUBLIC, PRIVATE, FRIENDS_ONLY
      isPinned  Boolean @default(false)
      tags      String? // JSON array of tags
    
      // --- Engagement Metrics ---
      viewCount     Int @default(0)
      likeCount     Int @default(0)
      commentCount  Int @default(0)
      shareCount    Int @default(0)
    
      // --- Timestamps ---
      createdAt DateTime @default(now())
      updatedAt DateTime @updatedAt
    
      // --- Virtual Relationships ---
      deletedPost   DeletedPost?
      textPost      TextPost?
      linkPost      LinkPost?
      pollPost      PollPost?
      questionPost  QuestionPost?
      jobPost       JobPost?
      comments      Comment[]
      reports       Report[]
      reactions     Reaction[]
      responses     Response[]
      attachments   Attachment[]
      postTopics    PostTopic[]
    }
    
    model DeletedPost {
      // --- Core Identification ---
      id String @id @default(ulid())
    
      // --- Relationships ---
      post   Post   @relation(fields: [postId], references: [id], onDelete: Cascade)
      postId String @unique
    
      // --- Deletion Details ---
      reason    String?
      deletedBy String? // Account ID of who deleted it
    
      // --- Timestamps ---
      createdAt DateTime @default(now())
      updatedAt DateTime @updatedAt
    }
    
    model TextPost {
      // --- Core Identification ---
      id String @id @default(ulid())
    
      // --- Relationships ---
      post   Post   @relation(fields: [postId], references: [id], onDelete: Cascade)
      postId String @unique
    
      // --- Text Content ---
      content   String
      formatting String? // JSON object for rich text formatting
    
      // --- Timestamps ---
      createdAt DateTime @default(now())
      updatedAt DateTime @updatedAt
    }
    
    model LinkPost {
      // --- Core Identification ---
      id String @id @default(ulid())
    
      // --- Relationships ---
      post   Post   @relation(fields: [postId], references: [id], onDelete: Cascade)
      postId String @unique
    
      // --- Link Details ---
      url         String
      title       String?
      description String?
      imageUrl    String?
      domain      String?
    
      // --- Timestamps ---
      createdAt DateTime @default(now())
      updatedAt DateTime @updatedAt
    }
    
    model PollPost {
      // --- Core Identification ---
      id String @id @default(ulid())
    
      // --- Relationships ---
      post   Post   @relation(fields: [postId], references: [id], onDelete: Cascade)
      postId String @unique
    
      // --- Poll Details ---
      question      String
      options       String  // JSON array of poll options
      allowMultiple Boolean @default(false)
      expiresAt     DateTime?
      totalVotes    Int     @default(0)
    
      // --- Timestamps ---
      createdAt DateTime @default(now())
      updatedAt DateTime @updatedAt
    
      // --- Virtual Relationships ---
      votes PollVote[]
    }
    
    model PollVote {
      // --- Core Identification ---
      id String @id @default(ulid())
    
      // --- Relationships ---
      poll   PollPost @relation(fields: [pollId], references: [id], onDelete: Cascade)
      pollId String
    
      voter   Account @relation(fields: [voterId], references: [id])
      voterId String
    
      // --- Vote Details ---
      selectedOptions String // JSON array of selected option indices
    
      // --- Timestamps ---
      createdAt DateTime @default(now())
      updatedAt DateTime @updatedAt
    
      @@unique([pollId, voterId])
    }
    
    model QuestionPost {
      // --- Core Identification ---
      id String @id @default(ulid())
    
      // --- Relationships ---
      post   Post   @relation(fields: [postId], references: [id], onDelete: Cascade)
      postId String @unique
    
      // --- Question Details ---
      question     String
      category     String?
      difficulty   String? // EASY, MEDIUM, HARD
      bounty       Decimal? // reward for best answer
      isSolved     Boolean @default(false)
      bestAnswerId String?
    
      // --- Timestamps ---
      createdAt DateTime @default(now())
      updatedAt DateTime @updatedAt
    }
    
    model JobPost {
      // --- Core Identification ---
      id String @id @default(ulid())
    
      // --- Relationships ---
      post   Post   @relation(fields: [postId], references: [id], onDelete: Cascade)
      postId String @unique
    
      // --- Job Details ---
      title           String
      company         String
      location        String
      jobType         String  // FULL_TIME, PART_TIME, CONTRACT, INTERNSHIP
      experienceLevel String? // ENTRY, MID, SENIOR, EXECUTIVE
      salaryMin       Decimal?
      salaryMax       Decimal?
      currency        String  @default("USD")
      requirements    String? // JSON array of requirements
      benefits        String? // JSON array of benefits
      applicationUrl  String?
      expiresAt       DateTime?
      isRemote        Boolean @default(false)
    
      // --- Timestamps ---
      createdAt DateTime @default(now())
      updatedAt DateTime @updatedAt
    }
    
    // ================
    model Comment {
      // --- Core Identification ---
      id String @id @default(ulid())
    
      // --- Relationships ---
      post   Post   @relation(fields: [postId], references: [id], onDelete: Cascade)
      postId String
    
      author   Account @relation(fields: [authorId], references: [id])
      authorId String
    
      // --- Comment Details ---
      content   String
      isEdited  Boolean @default(false)
      likeCount Int     @default(0)
    
      // --- Timestamps ---
      createdAt DateTime @default(now())
      updatedAt DateTime @updatedAt
    
      // --- Virtual Relationships ---
      replies     Reply[]
      attachments Attachment[]
    }
    
    model Reply {
      // --- Core Identification ---
      id String @id @default(ulid())
    
      // --- Relationships ---
      comment   Comment @relation(fields: [commentId], references: [id], onDelete: Cascade)
      commentId String
    
      author   Account @relation(fields: [authorId], references: [id])
      authorId String
    
      // --- Reply Details ---
      content   String
      isEdited  Boolean @default(false)
      likeCount Int     @default(0)
    
      // --- Timestamps ---
      createdAt DateTime @default(now())
      updatedAt DateTime @updatedAt
    }
    
    // ================
    model Attachment {
      // --- Core Identification ---
      id String @id @default(ulid())
    
      // --- Relationships ---
    

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.