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

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

model Article {
  id          String     @id @default(uuid())
  title       String
  description String
  likes       Int        @default(0)
  dislikes    Int        @default(0)
  comments    Comment[] 
  createdAt   DateTime   @default(now())
  updatedAt   DateTime   @updatedAt
}

model Comment {
  id          String     @id @default(uuid())
  content     String
  likes       Int        @default(0)
  dislikes    Int        @default(0)
  articleId   String     // Foreign key for the related article
  article     Article    @relation(fields: [articleId], references: [id]) // Define relationship
  createdAt   DateTime   @default(now())
  updatedAt   DateTime   @updatedAt
}

model Charte {
  id          String   @id @default(uuid())
  name       String  
  email      String  
  comment    String?
  createdAt   DateTime @default(now()) 
}


