mirror of
https://github.com/Portabase/portabase.git
synced 2026-07-14 11:16:13 +02:00
112 lines
2.8 KiB
Plaintext
112 lines
2.8 KiB
Plaintext
// This is your Prisma schema file,
|
|
// learn more about it in the docs: https://pris.ly/d/prisma-schema
|
|
|
|
// Looking for ways to speed up your queries, or scale easily with your serverless or edge functions?
|
|
// Try Prisma Accelerate: https://pris.ly/cli/accelerate-init
|
|
|
|
generator client {
|
|
provider = "prisma-client-js"
|
|
binaryTargets = ["native", "linux-musl-openssl-3.0.x", "debian-openssl-3.0.x"]
|
|
}
|
|
|
|
datasource db {
|
|
provider = "postgresql"
|
|
url = env("DATABASE_URL")
|
|
}
|
|
|
|
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 VerificationToken {
|
|
identifier String
|
|
token String
|
|
expires DateTime
|
|
|
|
@@unique([identifier, token])
|
|
@@map("verificationtokens")
|
|
}
|
|
|
|
model User {
|
|
id String @id @default(cuid())
|
|
name String?
|
|
email String? @unique
|
|
emailVerified DateTime? @map("email_verified")
|
|
image String?
|
|
role String?
|
|
password String?
|
|
|
|
accounts Account[]
|
|
sessions Session[]
|
|
authMethod String?
|
|
createdAt DateTime @default(now()) @map("created_at")
|
|
updatedAt DateTime? @updatedAt @map("updated_at")
|
|
|
|
@@map("users")
|
|
}
|
|
|
|
model Agent {
|
|
id String @id @default(cuid())
|
|
name String
|
|
description String?
|
|
lastContact DateTime? @map("last_contact")
|
|
createdAt DateTime @default(now()) @map("created_at")
|
|
}
|
|
|
|
model Database {
|
|
id String @id @default(cuid())
|
|
agentId String @map("agent_id")
|
|
name String
|
|
description String?
|
|
backupPolicy String? @map("backup_policy")
|
|
createdAt DateTime @default(now()) @map("created_at")
|
|
}
|
|
|
|
enum Status {
|
|
waiting
|
|
ongoing
|
|
failed
|
|
success
|
|
}
|
|
|
|
model Backup {
|
|
id String @id @default(cuid())
|
|
databaseId String @map("database_id")
|
|
status Status @default(waiting)
|
|
file String?
|
|
createdAt DateTime @default(now()) @map("created_at")
|
|
}
|
|
|
|
model Restore {
|
|
id String @id @default(cuid())
|
|
backupId String @map("backup_id")
|
|
status Status @default(waiting)
|
|
createdAt DateTime @default(now()) @map("created_at")
|
|
}
|