139 lines
3.8 KiB
Plaintext
139 lines
3.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"
|
|
}
|
|
|
|
datasource db {
|
|
provider = "mysql"
|
|
url = env("DATABASE_URL")
|
|
}
|
|
|
|
model Account {
|
|
id String @id @default(cuid())
|
|
userId String
|
|
type String
|
|
provider String
|
|
providerAccountId String
|
|
refresh_token String? @db.Text
|
|
refresh_token_expires_in Int?
|
|
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])
|
|
}
|
|
|
|
model Session {
|
|
id String @id @default(cuid())
|
|
sessionToken String @unique
|
|
userId String
|
|
expires DateTime
|
|
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
|
}
|
|
|
|
model User {
|
|
id String @id @default(cuid())
|
|
name String?
|
|
username String @unique
|
|
email String? @unique
|
|
emailVerified DateTime?
|
|
image String?
|
|
accounts Account[]
|
|
sessions Session[]
|
|
Workspace Workspace[]
|
|
Deployment Deployment[]
|
|
}
|
|
|
|
model VerificationToken {
|
|
identifier String
|
|
token String @unique
|
|
expires DateTime
|
|
|
|
@@unique([identifier, token])
|
|
}
|
|
|
|
model Workspace {
|
|
id String @id @default(cuid())
|
|
name String
|
|
slug String @unique
|
|
description String?
|
|
owner User @relation(fields: [ownerId], references: [id])
|
|
ownerId String
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
Application Application[]
|
|
Deployment Deployment[]
|
|
Database Database[]
|
|
}
|
|
|
|
model Database {
|
|
id String @id @default(cuid())
|
|
name String
|
|
provider DatabaseProvider
|
|
|
|
host String
|
|
port Int
|
|
username String
|
|
password String
|
|
|
|
workspaceId String
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
|
|
Workspace Workspace @relation(fields: [workspaceId], references: [id], onDelete: Cascade)
|
|
}
|
|
|
|
enum DatabaseProvider {
|
|
VITESS
|
|
REDIS
|
|
POSTGRES
|
|
}
|
|
|
|
model Application {
|
|
id String @id @default(cuid())
|
|
name String
|
|
serviceProvider String
|
|
repository String
|
|
branch String
|
|
repositoryId String
|
|
path String
|
|
autoDeploy Boolean
|
|
workspaceId String
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
Deployment Deployment[]
|
|
|
|
Workspace Workspace @relation(fields: [workspaceId], references: [id], onDelete: Cascade)
|
|
}
|
|
|
|
enum DeploymentStatus {
|
|
PENDING
|
|
IN_PROGRESS
|
|
FAILED
|
|
SUCCESS
|
|
}
|
|
|
|
model Deployment {
|
|
id String @id @default(cuid())
|
|
applicationId String
|
|
workspaceId String
|
|
userId String
|
|
status DeploymentStatus @default(PENDING)
|
|
createdAt DateTime @default(now())
|
|
updatedAt DateTime @updatedAt
|
|
|
|
Application Application @relation(fields: [applicationId], references: [id], onDelete: Cascade)
|
|
Workspace Workspace @relation(fields: [workspaceId], references: [id], onDelete: Cascade)
|
|
User User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
|
}
|