Advertisement
elliottchong

Prisma Next Auth Starter Code

Jul 23rd, 2023
2,437
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. generator client {
  2. provider = "prisma-client-js"
  3. }
  4.  
  5. datasource db {
  6. provider = "mysql"
  7. url = env("DATABASE_URL")
  8. relationMode = "prisma"
  9. }
  10.  
  11. model Account {
  12. id String @id @default(cuid())
  13. userId String
  14. type String
  15. provider String
  16. providerAccountId String
  17. refresh_token String? @db.Text
  18. access_token String? @db.Text
  19. expires_at Int?
  20. token_type String?
  21. scope String?
  22. id_token String? @db.Text
  23. session_state String?
  24. user User @relation(fields: [userId], references: [id], onDelete: Cascade)
  25. @@unique([provider, providerAccountId])
  26. }
  27.  
  28. model Session {
  29. id String @id @default(cuid())
  30. sessionToken String @unique
  31. userId String
  32. expires DateTime
  33. user User @relation(fields: [userId], references: [id], onDelete: Cascade)
  34. }
  35.  
  36. model User {
  37. id String @id @default(cuid())
  38. name String?
  39. email String? @unique
  40. emailVerified DateTime?
  41. image String?
  42. accounts Account[]
  43. sessions Session[]
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement