type UserConversation @table(name: "user_conversations", key: ["conversationId", "userId"]) {
  id: UUID! @default(expr: "uuidV4()")

  conversationId: UUID!
  conversation: Conversation! @ref(fields: "conversationId", references: "id")

  userId: String!
  user: User! @ref(fields: "userId", references: "id")

  # per-user state
  unreadCount: Int @default(expr: "0")
  lastReadAt: Timestamp

  createdAt: Timestamp @default(expr: "request.time")
  updatedAt: Timestamp @default(expr: "request.time")
  createdBy: String
}