help with prisma schema (coming from sql)

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

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

model User {
  id        String   @id @default(auto()) @map("_id") @db.ObjectId
  email     String   @unique
  password  String
  createdAt DateTime @default(now())
  updatedAt DateTime @updatedAt
+  Slot      Slot?    @relation(fields: [slotId], references: [id])
+  slotId    String?  @db.ObjectId
}

model Slot {
  id        String   @id @default(auto()) @map("_id") @db.ObjectId
  timestamp DateTime @unique
+  users     User[]
}
Was this page helpful?