lasthourcloud/apps/api/prisma/schema.prisma

647 lines
21 KiB
Plaintext
Raw Normal View History

2022-02-10 14:47:44 +00:00
generator client {
provider = "prisma-client-js"
2022-09-02 13:35:24 +00:00
binaryTargets = ["native"]
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
2022-09-06 12:08:10 +00:00
isAPIDebuggingEnabled Boolean? @default(false)
2022-02-10 14:47:44 +00:00
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-08-17 08:43:57 +00:00
DNSServers String?
isTraefikUsed Boolean @default(true)
2022-02-10 14:47:44 +00:00
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
ipv4 String?
ipv6 String?
arch String?
2022-08-25 08:04:46 +00:00
concurrentBuilds Int @default(1)
2022-02-10 14:47:44 +00:00
}
model User {
id String @id @unique @default(cuid())
email String @unique
type String
password String?
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
permission Permission[]
teams Team[]
2022-02-10 14:47:44 +00:00
}
model Permission {
id String @id @default(cuid())
userId String
teamId String
permission String
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
team Team @relation(fields: [teamId], references: [id])
user User @relation(fields: [userId], references: [id])
2022-02-10 14:47:44 +00:00
}
model Team {
id String @id @default(cuid())
name String?
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
databaseId String?
serviceId String?
permissions Permission[]
sshKey SshKey[]
applications Application[]
database Database[]
destinationDocker DestinationDocker[]
gitSources GitSource[]
gitHubApps GithubApp[]
gitLabApps GitlabApp[]
service Service[]
users User[]
2022-02-10 14:47:44 +00:00
}
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-08-06 09:21:16 +00:00
fqdn String?
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?
deploymentType 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
destinationDockerId String?
gitSourceId String?
2022-04-25 21:44:06 +00:00
baseImage String?
2022-04-26 12:51:08 +00:00
baseBuildImage String?
gitSource GitSource? @relation(fields: [gitSourceId], references: [id])
destinationDocker DestinationDocker? @relation(fields: [destinationDockerId], references: [id])
persistentStorage ApplicationPersistentStorage[]
settings ApplicationSettings?
secrets Secret[]
teams Team[]
connectedDatabase ApplicationConnectedDatabase?
2022-09-13 13:50:20 +00:00
previewApplication PreviewApplication[]
2022-09-13 07:57:57 +00:00
}
model PreviewApplication {
2022-09-13 13:50:20 +00:00
id String @id @default(cuid())
pullmergeRequestId String
sourceBranch String
isRandomDomain Boolean @default(false)
customDomain String?
applicationId String @unique
application Application @relation(fields: [applicationId], references: [id])
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
model ApplicationConnectedDatabase {
id String @id @default(cuid())
applicationId String @unique
databaseId String?
hostedDatabaseType String?
hostedDatabaseHost String?
hostedDatabasePort Int?
hostedDatabaseName String?
hostedDatabaseUser String?
hostedDatabasePassword String?
hostedDatabaseDBName String?
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
database Database? @relation(fields: [databaseId], references: [id])
application Application @relation(fields: [applicationId], references: [id])
2022-02-10 14:47:44 +00:00
}
model ApplicationSettings {
2022-08-18 09:53:42 +00:00
id String @id @default(cuid())
applicationId String @unique
dualCerts Boolean @default(false)
debug Boolean @default(false)
previews Boolean @default(false)
autodeploy Boolean @default(true)
isBot Boolean @default(false)
isPublicRepository Boolean @default(false)
2022-09-05 07:09:49 +00:00
isDBBranching Boolean @default(false)
2022-08-18 09:53:42 +00:00
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
application Application @relation(fields: [applicationId], references: [id])
2022-02-10 14:47:44 +00:00
}
2022-03-20 22:51:50 +00:00
model ApplicationPersistentStorage {
id String @id @default(cuid())
applicationId String
path String
2022-03-20 22:51:50 +00:00
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
application Application @relation(fields: [applicationId], references: [id])
2022-03-20 22:51:50 +00:00
@@unique([applicationId, path])
}
model ServicePersistentStorage {
id String @id @default(cuid())
serviceId String
path String
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
service Service @relation(fields: [serviceId], references: [id])
@@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
applicationId String
application Application @relation(fields: [applicationId], references: [id])
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
serviceId String
service Service @relation(fields: [serviceId], references: [id])
2022-03-04 14:14:25 +00:00
@@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 BigInt
2022-02-10 14:47:44 +00:00
}
model Build {
2022-09-13 13:50:20 +00:00
id String @id @default(cuid())
type String
applicationId String?
destinationDockerId String?
gitSourceId String?
githubAppId String?
gitlabAppId String?
commit String?
pullmergeRequestId String?
previewApplicationId String?
forceRebuild Boolean @default(false)
sourceBranch String?
branch String?
status String? @default("queued")
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
2022-02-10 14:47:44 +00:00
}
model DestinationDocker {
id String @id @default(cuid())
network String @unique
name String
2022-07-18 14:02:53 +00:00
engine String?
2022-02-10 14:47:44 +00:00
remoteEngine Boolean @default(false)
2022-07-18 14:02:53 +00:00
remoteIpAddress String?
remoteUser String?
remotePort Int?
remoteVerified Boolean @default(false)
2022-02-10 14:47:44 +00:00
isCoolifyProxyUsed Boolean? @default(false)
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
sshKeyId String?
sshKey SshKey? @relation(fields: [sshKeyId], references: [id])
2022-08-06 10:23:51 +00:00
sshLocalPort Int?
application Application[]
2022-02-10 14:47:44 +00:00
database Database[]
service Service[]
teams Team[]
2022-07-18 14:02:53 +00:00
}
model SshKey {
2022-07-21 12:43:53 +00:00
id String @id @default(cuid())
name String
privateKey String
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
2022-07-26 12:26:45 +00:00
teamId String?
team Team? @relation(fields: [teamId], references: [id])
destinationDocker DestinationDocker[]
2022-02-10 14:47:44 +00:00
}
model GitSource {
id String @id @default(cuid())
name String
2022-08-18 09:53:42 +00:00
forPublic Boolean @default(false)
2022-02-10 14:47:44 +00:00
type String?
apiUrl String?
htmlUrl String?
2022-07-12 09:01:48 +00:00
customPort Int @default(22)
2022-02-10 14:47:44 +00:00
organization String?
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
githubAppId String? @unique
gitlabAppId String? @unique
gitlabApp GitlabApp? @relation(fields: [gitlabAppId], references: [id])
githubApp GithubApp? @relation(fields: [githubAppId], references: [id])
application Application[]
teams Team[]
2022-02-10 14:47:44 +00:00
}
model GithubApp {
id String @id @default(cuid())
name String? @unique
appId Int?
installationId Int?
clientId String?
clientSecret String?
webhookSecret String?
privateKey String?
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
gitSource GitSource?
teams Team[]
2022-02-10 14:47:44 +00:00
}
model GitlabApp {
id String @id @default(cuid())
oauthId Int @unique
groupName String? @unique
deployKeyId Int?
privateSshKey String?
publicSshKey String?
webhookToken String?
appId String?
appSecret String?
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
gitSource GitSource?
teams Team[]
2022-02-10 14:47:44 +00:00
}
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?
destinationDockerId String?
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
destinationDocker DestinationDocker? @relation(fields: [destinationDockerId], references: [id])
settings DatabaseSettings?
teams Team[]
applicationConnectedDatabase ApplicationConnectedDatabase[]
2022-09-07 09:40:52 +00:00
databaseSecret DatabaseSecret[]
}
model DatabaseSecret {
id String @id @default(cuid())
name String
value String
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
databaseId String
database Database @relation(fields: [databaseId], references: [id])
@@unique([name, databaseId])
2022-02-10 14:47:44 +00:00
}
model DatabaseSettings {
id String @id @default(cuid())
databaseId String @unique
isPublic Boolean @default(false)
appendOnly Boolean @default(true)
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
database Database @relation(fields: [databaseId], references: [id])
2022-02-10 14:47:44 +00:00
}
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?
destinationDockerId String?
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
destinationDocker DestinationDocker? @relation(fields: [destinationDockerId], references: [id])
persistentStorage ServicePersistentStorage[]
serviceSecret ServiceSecret[]
2022-08-23 08:11:38 +00:00
teams Team[]
2022-08-15 14:58:10 +00:00
2022-08-23 08:11:38 +00:00
fider Fider?
ghost Ghost?
glitchTip GlitchTip?
hasura Hasura?
meiliSearch MeiliSearch?
minio Minio?
moodle Moodle?
plausibleAnalytics PlausibleAnalytics?
umami Umami?
vscodeserver Vscodeserver?
wordpress Wordpress?
appwrite Appwrite?
searxng Searxng?
2022-08-31 13:02:05 +00:00
weblate Weblate?
2022-09-02 12:11:36 +00:00
taiga Taiga?
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?
2022-05-09 13:05:24 +00:00
scriptName String @default("plausible.js")
2022-02-10 14:47:44 +00:00
serviceId String @unique
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
service Service @relation(fields: [serviceId], references: [id])
2022-02-10 14:47:44 +00:00
}
model Minio {
id String @id @default(cuid())
rootUser String
rootUserPassword String
publicPort Int?
2022-05-19 11:45:17 +00:00
apiFqdn String?
2022-02-10 14:47:44 +00:00
serviceId String @unique
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
service Service @relation(fields: [serviceId], references: [id])
2022-02-10 14:47:44 +00:00
}
model Vscodeserver {
id String @id @default(cuid())
password String
serviceId String @unique
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
service Service @relation(fields: [serviceId], references: [id])
2022-02-10 14:47:44 +00:00
}
model Wordpress {
id String @id @default(cuid())
extraConfig String?
tablePrefix String?
2022-05-10 08:12:13 +00:00
ownMysql Boolean @default(false)
mysqlHost String?
mysqlPort Int?
2022-02-10 14:47:44 +00:00
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
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
service Service @relation(fields: [serviceId], references: [id])
2022-02-10 14:47:44 +00:00
}
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
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
service Service @relation(fields: [serviceId], references: [id])
2022-03-27 20:03:21 +00:00
}
2022-04-02 21:08:27 +00:00
model MeiliSearch {
id String @id @default(cuid())
masterKey String
serviceId String @unique
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
service Service @relation(fields: [serviceId], references: [id])
2022-04-02 21:08:27 +00:00
}
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
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
service Service @relation(fields: [serviceId], references: [id])
2022-04-24 22:00:06 +00:00
}
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
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
service Service @relation(fields: [serviceId], references: [id])
2022-04-27 13:37:50 +00:00
}
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)
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
service Service @relation(fields: [serviceId], references: [id])
2022-04-29 20:25:27 +00:00
}
model Moodle {
id String @id @default(cuid())
serviceId String @unique
defaultUsername String
defaultPassword String
defaultEmail String
mariadbUser String
mariadbPassword String
mariadbRootUser String
mariadbRootUserPassword String
mariadbDatabase String
mariadbPublicPort Int?
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
service Service @relation(fields: [serviceId], references: [id])
}
2022-08-15 09:56:34 +00:00
2022-08-15 14:58:10 +00:00
model Appwrite {
id String @id @default(cuid())
serviceId String @unique
opensslKeyV1 String
executorSecret String
redisPassword String
mariadbHost String?
mariadbPort Int @default(3306)
mariadbUser String
mariadbPassword String
mariadbRootUser String
mariadbRootUserPassword String
mariadbDatabase String
mariadbPublicPort Int?
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
service Service @relation(fields: [serviceId], references: [id])
}
2022-08-15 09:56:34 +00:00
model GlitchTip {
id String @id @default(cuid())
postgresqlUser String
postgresqlPassword String
postgresqlDatabase String
postgresqlPublicPort Int?
secretKeyBase String?
defaultEmail String
defaultUsername String
defaultPassword String
defaultEmailFrom String @default("glitchtip@domain.tdl")
emailSmtpHost String? @default("domain.tdl")
emailSmtpPort Int? @default(25)
emailSmtpUser String?
emailSmtpPassword String?
emailSmtpUseTls Boolean? @default(false)
emailSmtpUseSsl Boolean? @default(false)
emailBackend String?
mailgunApiKey String?
sendgridApiKey String?
enableOpenUserRegistration Boolean @default(true)
serviceId String @unique
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
service Service @relation(fields: [serviceId], references: [id])
}
2022-08-23 08:11:38 +00:00
model Searxng {
id String @id @default(cuid())
secretKey String
redisPassword String
serviceId String @unique
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
service Service @relation(fields: [serviceId], references: [id])
}
2022-08-31 13:02:05 +00:00
model Weblate {
id String @id @default(cuid())
adminPassword String
postgresqlHost String
postgresqlPort Int
postgresqlUser String
postgresqlPassword String
postgresqlDatabase String
postgresqlPublicPort Int?
serviceId String @unique
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
service Service @relation(fields: [serviceId], references: [id])
}
2022-09-02 12:11:36 +00:00
model Taiga {
id String @id @default(cuid())
secretKey String
erlangSecret String
djangoAdminPassword String
djangoAdminUser String
rabbitMQUser String
rabbitMQPassword String
postgresqlHost String
postgresqlPort Int
postgresqlUser String
postgresqlPassword String
postgresqlDatabase String
postgresqlPublicPort Int?
serviceId String @unique
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
service Service @relation(fields: [serviceId], references: [id])
}