// 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" } generator zod { provider = "zod-prisma" output = "../src/shared/model/generated-zod" // (default) the directory where generated zod schemas will be saved relationModel = true // (default) Create and export both plain and related models. // relationModel = "default" // Do not export model without relations. // relationModel = false // Do not generate related model modelCase = "PascalCase" // (default) Output models using pascal case (ex. UserModel, PostModel) // modelCase = "camelCase" // Output models using camel case (ex. userModel, postModel) modelSuffix = "Model" // (default) Suffix to apply to your prisma models when naming Zod schemas // useDecimalJs = false // (default) represent the prisma Decimal type using as a JS number useDecimalJs = true // represent the prisma Decimal type using Decimal.js (as Prisma does) imports = null // (default) will import the referenced file in generated schemas to be used via imports.someExportedVariable // https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-by-null-values prismaJsonNullability = true // (default) uses prisma's scheme for JSON field nullability // prismaJsonNullability = false // allows null assignment to optional JSON fields } datasource db { provider = "sqlite" url = "file:../storage/db/data.db" } // *** The following code is for the default NextAuth.js schema model Account { 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? createdAt DateTime @default(now()) updatedAt DateTime @updatedAt user User @relation(fields: [userId], references: [id], onDelete: Cascade) @@id([provider, providerAccountId]) } model Session { sessionToken String @unique userId String expires DateTime user User @relation(fields: [userId], references: [id], onDelete: Cascade) createdAt DateTime @default(now()) updatedAt DateTime @updatedAt } model User { id String @id @default(cuid()) name String? email String @unique emailVerified DateTime? password String twoFaSecret String? twoFaEnabled Boolean @default(false) image String? accounts Account[] sessions Session[] // Optional for WebAuthn support Authenticator Authenticator[] createdAt DateTime @default(now()) updatedAt DateTime @updatedAt } model VerificationToken { identifier String token String expires DateTime @@id([identifier, token]) } // Optional for WebAuthn support model Authenticator { credentialID String @unique userId String providerAccountId String credentialPublicKey String counter Int credentialDeviceType String credentialBackedUp Boolean transports String? user User @relation(fields: [userId], references: [id], onDelete: Cascade) @@id([userId, credentialID]) } // *** FROM HERE CUSTOM CLASSES model Project { id String @id @default(uuid()) name String apps App[] createdAt DateTime @default(now()) updatedAt DateTime @updatedAt } model App { id String @id @default(uuid()) name String projectId String project Project @relation(fields: [projectId], references: [id], onDelete: Cascade) sourceType String @default("GIT") // GIT, CONTAINER containerImageSource String? gitUrl String? gitBranch String? gitUsername String? gitToken String? dockerfilePath String @default("./Dockerfile") replicas Int @default(1) envVars String @default("") memoryReservation Int? memoryLimit Int? cpuReservation Int? cpuLimit Int? appDomains AppDomain[] appVolumes AppVolume[] appPorts AppPort[] createdAt DateTime @default(now()) updatedAt DateTime @updatedAt } model AppPort { id String @id @default(uuid()) appId String app App @relation(fields: [appId], references: [id], onDelete: Cascade) port Int createdAt DateTime @default(now()) updatedAt DateTime @updatedAt @@unique([appId, port]) } model AppDomain { id String @id @default(uuid()) hostname String @unique port Int useSsl Boolean @default(true) redirectHttps Boolean @default(true) appId String app App @relation(fields: [appId], references: [id], onDelete: Cascade) createdAt DateTime @default(now()) updatedAt DateTime @updatedAt } model AppVolume { id String @id @default(uuid()) containerMountPath String size Int accessMode String @default("rwo") appId String app App @relation(fields: [appId], references: [id], onDelete: Cascade) createdAt DateTime @default(now()) updatedAt DateTime @updatedAt @@unique([appId, containerMountPath]) } model Parameter { name String @id value String createdAt DateTime @default(now()) updatedAt DateTime @updatedAt }