mythic-bastionland/prisma/schema.prisma
2025-10-10 19:44:33 +11:00

77 lines
1.6 KiB
Plaintext

// Prisma schema for NextAuth (SQLite) with credential passwords
datasource db {
provider = "sqlite"
url = env("DATABASE_URL")
}
generator client {
provider = "prisma-client-js"
}
model User {
id String @id @default(cuid())
name String?
email String? @unique
emailVerified DateTime?
image String?
password String?
accounts Account[]
sessions Session[]
}
model Account {
id String @id @default(cuid())
userId String
type String
provider String
providerAccountId String
refresh_token String?
access_token String?
expires_at Int?
token_type String?
scope String?
id_token String?
session_state String?
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
@@unique([provider, providerAccountId])
}
model Session {
id String @id @default(cuid())
sessionToken String @unique
userId String
expires DateTime
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
}
model VerificationToken {
identifier String
token String @unique
expires DateTime
@@unique([identifier, token])
}
model Game {
id String @id @default(cuid())
createdAt DateTime @default(now())
saves Save[]
}
model Save {
id String @id @default(cuid())
createdAt DateTime @default(now())
state String // JSON string payload
game Game @relation(fields: [gameId], references: [id], onDelete: Cascade)
gameId String
}