lasthourcloud/prisma/schema.prisma

446 lines
14 KiB
Plaintext
Raw Normal View History

2022-02-10 14:47:44 +00:00
generator client {
provider = "prisma-client-js"
binaryTargets = ["native", "linux-musl"]
2022-02-10 14:47:44 +00:00
}
datasource db {
provider = "sqlite"
url = env("COOLIFY_DATABASE_URL")
}
model Setting {
id String @id @default(cuid())
fqdn String? @unique
isRegistrationEnabled Boolean @default(false)
dualCerts Boolean @default(false)
2022-02-20 14:12:01 +00:00
minPort Int @default(9000)
maxPort Int @default(9100)
2022-02-10 14:47:44 +00:00
proxyPassword String
proxyUser String
2022-02-28 23:08:54 +00:00
proxyHash String?
2022-04-25 07:54:28 +00:00
isAutoUpdateEnabled Boolean @default(false)
isDNSCheckEnabled Boolean @default(true)
2022-02-10 14:47:44 +00:00
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
model User {
id String @id @unique @default(cuid())
email String @unique
type String
password String?
teams Team[]
permission Permission[]
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
model Permission {
id String @id @default(cuid())
user User @relation(fields: [userId], references: [id])
userId String
team Team @relation(fields: [teamId], references: [id])
teamId String
permission String
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
model Team {
id String @id @default(cuid())
users User[]
name String?
applications Application[]
gitSources GitSource[]
gitHubApps GithubApp[]
gitLabApps GitlabApp[]
destinationDocker DestinationDocker[]
permissions Permission[]
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
2022-02-23 14:47:09 +00:00
database Database[] @relation(references: [id])
2022-02-10 14:47:44 +00:00
databaseId String?
2022-02-23 14:47:09 +00:00
service Service[] @relation(references: [id])
2022-02-10 14:47:44 +00:00
serviceId String?
}
model TeamInvitation {
id String @id @default(cuid())
uid String
email String
teamId String
teamName String
permission String
createdAt DateTime @default(now())
}
model Application {
2022-03-20 22:51:50 +00:00
id String @id @default(cuid())
2022-02-10 14:47:44 +00:00
name String
2022-03-20 22:51:50 +00:00
fqdn String? @unique
2022-02-10 14:47:44 +00:00
repository String?
configHash String?
branch String?
buildPack String?
projectId Int?
port Int?
2022-04-08 07:12:01 +00:00
exposePort Int?
2022-02-10 14:47:44 +00:00
installCommand String?
buildCommand String?
startCommand String?
baseDirectory String?
publishDirectory String?
2022-03-20 22:51:50 +00:00
phpModules String?
2022-04-02 14:22:51 +00:00
pythonWSGI String?
pythonModule String?
pythonVariable String?
2022-04-24 22:00:06 +00:00
dockerFileLocation String?
2022-04-20 20:24:00 +00:00
denoMainFile String?
2022-04-24 22:00:06 +00:00
denoOptions String?
2022-03-20 22:51:50 +00:00
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
2022-02-10 14:47:44 +00:00
settings ApplicationSettings?
teams Team[]
destinationDockerId String?
2022-03-20 22:51:50 +00:00
destinationDocker DestinationDocker? @relation(fields: [destinationDockerId], references: [id])
2022-02-10 14:47:44 +00:00
gitSourceId String?
2022-03-20 22:51:50 +00:00
gitSource GitSource? @relation(fields: [gitSourceId], references: [id])
2022-02-10 14:47:44 +00:00
secrets Secret[]
2022-03-20 22:51:50 +00:00
persistentStorage ApplicationPersistentStorage[]
2022-04-25 21:44:06 +00:00
baseImage String?
2022-04-26 12:51:08 +00:00
baseBuildImage String?
2022-02-10 14:47:44 +00:00
}
model ApplicationSettings {
id String @id @default(cuid())
application Application @relation(fields: [applicationId], references: [id])
applicationId String @unique
dualCerts Boolean @default(false)
2022-02-10 14:47:44 +00:00
debug Boolean @default(false)
previews Boolean @default(false)
2022-03-11 21:36:21 +00:00
autodeploy Boolean @default(true)
2022-02-10 14:47:44 +00:00
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
2022-03-20 22:51:50 +00:00
model ApplicationPersistentStorage {
id String @id @default(cuid())
application Application @relation(fields: [applicationId], references: [id])
applicationId String
path String
2022-03-20 22:51:50 +00:00
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
@@unique([applicationId, path])
}
model ServicePersistentStorage {
id String @id @default(cuid())
service Service @relation(fields: [serviceId], references: [id])
serviceId String
path String
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
@@unique([serviceId, path])
}
2022-02-10 14:47:44 +00:00
model Secret {
id String @id @default(cuid())
name String
2022-02-10 14:47:44 +00:00
value String
2022-02-19 13:54:47 +00:00
isPRMRSecret Boolean @default(false)
2022-02-10 14:47:44 +00:00
isBuildSecret Boolean @default(false)
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
application Application @relation(fields: [applicationId], references: [id])
applicationId String
2022-02-19 13:54:47 +00:00
@@unique([name, applicationId, isPRMRSecret])
2022-02-10 14:47:44 +00:00
}
2022-03-04 14:14:25 +00:00
model ServiceSecret {
id String @id @default(cuid())
name String
value String
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
service Service @relation(fields: [serviceId], references: [id])
serviceId String
@@unique([name, serviceId])
}
2022-02-10 14:47:44 +00:00
model BuildLog {
id String @id @default(cuid())
applicationId String?
buildId String
line String
time Int
}
model Build {
id String @id @default(cuid())
type String
applicationId String?
destinationDockerId String?
gitSourceId String?
githubAppId String?
gitlabAppId String?
commit String?
branch String?
2022-02-10 14:47:44 +00:00
status String? @default("queued")
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
model DestinationDocker {
id String @id @default(cuid())
network String @unique
name String
engine String
remoteEngine Boolean @default(false)
isCoolifyProxyUsed Boolean? @default(false)
teams Team[]
application Application[]
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
database Database[]
service Service[]
}
model GitSource {
id String @id @default(cuid())
name String
teams Team[]
type String?
apiUrl String?
htmlUrl String?
organization String?
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
githubAppId String? @unique
githubApp GithubApp? @relation(fields: [githubAppId], references: [id])
application Application[]
gitlabAppId String? @unique
gitlabApp GitlabApp? @relation(fields: [gitlabAppId], references: [id])
}
model GithubApp {
id String @id @default(cuid())
name String? @unique
teams Team[]
appId Int?
installationId Int?
clientId String?
clientSecret String?
webhookSecret String?
privateKey String?
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
gitSource GitSource?
}
model GitlabApp {
id String @id @default(cuid())
oauthId Int @unique
groupName String? @unique
teams Team[]
deployKeyId Int?
privateSshKey String?
publicSshKey String?
webhookToken String?
appId String?
appSecret String?
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
gitSource GitSource?
}
model Database {
id String @id @default(cuid())
name String
publicPort Int?
defaultDatabase String?
type String?
version String?
dbUser String?
dbUserPassword String?
rootUser String?
rootUserPassword String?
settings DatabaseSettings?
destinationDocker DestinationDocker? @relation(fields: [destinationDockerId], references: [id])
destinationDockerId String?
teams Team[]
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
model DatabaseSettings {
id String @id @default(cuid())
database Database @relation(fields: [databaseId], references: [id])
databaseId String @unique
isPublic Boolean @default(false)
appendOnly Boolean @default(true)
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
model Service {
id String @id @default(cuid())
2022-02-10 14:47:44 +00:00
name String
fqdn String?
2022-04-30 12:47:00 +00:00
exposePort Int?
dualCerts Boolean @default(false)
2022-02-10 14:47:44 +00:00
type String?
version String?
teams Team[]
destinationDockerId String?
destinationDocker DestinationDocker? @relation(fields: [destinationDockerId], references: [id])
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
2022-02-10 14:47:44 +00:00
plausibleAnalytics PlausibleAnalytics?
minio Minio?
vscodeserver Vscodeserver?
wordpress Wordpress?
2022-03-27 20:03:21 +00:00
ghost Ghost?
2022-03-04 14:14:25 +00:00
serviceSecret ServiceSecret[]
2022-04-02 21:08:27 +00:00
meiliSearch MeiliSearch?
persistentStorage ServicePersistentStorage[]
2022-04-24 22:00:06 +00:00
umami Umami?
2022-04-27 13:37:50 +00:00
hasura Hasura?
2022-04-29 20:25:27 +00:00
fider Fider?
2022-02-10 14:47:44 +00:00
}
model PlausibleAnalytics {
id String @id @default(cuid())
email String?
username String?
password String
postgresqlUser String
postgresqlPassword String
postgresqlDatabase String
postgresqlPublicPort Int?
secretKeyBase String?
serviceId String @unique
service Service @relation(fields: [serviceId], references: [id])
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
model Minio {
id String @id @default(cuid())
rootUser String
rootUserPassword String
publicPort Int?
serviceId String @unique
service Service @relation(fields: [serviceId], references: [id])
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
model Vscodeserver {
id String @id @default(cuid())
password String
serviceId String @unique
service Service @relation(fields: [serviceId], references: [id])
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
model Wordpress {
id String @id @default(cuid())
extraConfig String?
tablePrefix String?
mysqlUser String
mysqlPassword String
mysqlRootUser String
mysqlRootUserPassword String
mysqlDatabase String?
mysqlPublicPort Int?
2022-04-05 13:56:25 +00:00
ftpEnabled Boolean @default(false)
ftpUser String?
ftpPassword String?
ftpPublicPort Int?
2022-04-06 19:37:42 +00:00
ftpHostKey String?
2022-04-05 13:56:25 +00:00
ftpHostKeyPrivate String?
2022-02-10 14:47:44 +00:00
serviceId String @unique
service Service @relation(fields: [serviceId], references: [id])
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
2022-03-27 20:03:21 +00:00
model Ghost {
id String @id @default(cuid())
defaultEmail String
defaultPassword String
mariadbUser String
mariadbPassword String
mariadbRootUser String
mariadbRootUserPassword String
mariadbDatabase String?
mariadbPublicPort Int?
serviceId String @unique
service Service @relation(fields: [serviceId], references: [id])
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
2022-04-02 21:08:27 +00:00
model MeiliSearch {
id String @id @default(cuid())
masterKey String
serviceId String @unique
service Service @relation(fields: [serviceId], references: [id])
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
2022-04-24 22:00:06 +00:00
model Umami {
id String @id @default(cuid())
serviceId String @unique
postgresqlUser String
postgresqlPassword String
postgresqlDatabase String
postgresqlPublicPort Int?
umamiAdminPassword String
hashSalt String
service Service @relation(fields: [serviceId], references: [id])
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
2022-04-27 13:37:50 +00:00
model Hasura {
id String @id @default(cuid())
serviceId String @unique
postgresqlUser String
postgresqlPassword String
postgresqlDatabase String
postgresqlPublicPort Int?
graphQLAdminPassword String
service Service @relation(fields: [serviceId], references: [id])
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
2022-04-29 20:25:27 +00:00
model Fider {
id String @id @default(cuid())
serviceId String @unique
postgresqlUser String
postgresqlPassword String
postgresqlDatabase String
postgresqlPublicPort Int?
jwtSecret String
emailNoreply String?
emailMailgunApiKey String?
emailMailgunDomain String?
2022-04-29 21:41:31 +00:00
emailMailgunRegion String @default("EU")
2022-04-29 20:25:27 +00:00
emailSmtpHost String?
emailSmtpPort Int?
emailSmtpUser String?
emailSmtpPassword String?
emailSmtpEnableStartTls Boolean @default(false)
service Service @relation(fields: [serviceId], references: [id])
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}