Skip to content

Instantly share code, notes, and snippets.

@finnmglas
Created July 5, 2025 13:15
Show Gist options
  • Save finnmglas/964f69942c6d4903ae9ac5608e3bd139 to your computer and use it in GitHub Desktop.
Save finnmglas/964f69942c6d4903ae9ac5608e3bd139 to your computer and use it in GitHub Desktop.
prisma nextauth base
generator client {
provider = "prisma-client-js"
}
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
directUrl = env("DATABASE_URL_UNPOOLED")
}
model Account {
id String @id @default(cuid())
userId String @map("user_id")
type String
provider String
providerAccountId String @map("provider_account_id")
refresh_token String? @db.Text
access_token String? @db.Text
expires_at Int?
token_type String?
scope String?
id_token String? @db.Text
session_state String?
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
@@unique([provider, providerAccountId])
@@map("accounts")
}
model Session {
id String @id @default(cuid())
sessionToken String @unique @map("session_token")
userId String @map("user_id")
expires DateTime
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
@@map("sessions")
}
model User {
id String @id @default(cuid())
isEmployee Boolean @default(false)
isSuperUser Boolean @default(false)
name String?
email String? @unique
emailVerified DateTime? @map("email_verified")
image String?
accounts Account[]
sessions Session[]
@@map("users")
}
model VerificationToken {
identifier String
token String
expires DateTime
@@unique([identifier, token])
@@map("verification_tokens")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment