generator client {
  provider = "prisma-client-js"
}

generator docs {
  provider = "node ./dist/index.js"
}

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

/// this is
model Post {
  /// this is id for the post
  id        Int      @default(autoincrement())
  createdAt DateTime @default(now())
  title     String
  content   String?
  published Boolean  @default(false)
  author    User     @relation(fields: [authorId], references: [id])
  authorId  Int      @default(1)

  @@id([id, authorId])
  @@unique([authorId])
  @@unique(name: "test", fields: [content, title])
  @@index([id, authorId])
  @@index([authorId, title])
  @@map("posts")
}

model Profile {
  id     Int     @id @default(autoincrement())
  bio    String?
  user   User    @relation(fields: [userId], references: [id])
  userId Int     @unique
}

model User {
  id         Int      @id @default(autoincrement())
  email      String   @unique
  name       String?
  posts      Post[]
  profile    Profile?
  arrayField String[] @default([])
}
