Created
July 5, 2025 13:15
-
-
Save finnmglas/964f69942c6d4903ae9ac5608e3bd139 to your computer and use it in GitHub Desktop.
prisma nextauth base
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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