mirror of
https://github.com/biersoeckli/QuickStack.git
synced 2026-01-05 19:21:17 -06:00
added example schema and project site
This commit is contained in:
52
prisma/migrations/20241021100307_migration/migration.sql
Normal file
52
prisma/migrations/20241021100307_migration/migration.sql
Normal file
@@ -0,0 +1,52 @@
|
||||
-- CreateTable
|
||||
CREATE TABLE "Project" (
|
||||
"id" TEXT NOT NULL PRIMARY KEY,
|
||||
"name" TEXT NOT NULL,
|
||||
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
"updatedAt" DATETIME NOT NULL
|
||||
);
|
||||
|
||||
-- CreateTable
|
||||
CREATE TABLE "App" (
|
||||
"id" TEXT NOT NULL PRIMARY KEY,
|
||||
"name" TEXT NOT NULL,
|
||||
"projectId" TEXT NOT NULL,
|
||||
"gitUrl" TEXT NOT NULL,
|
||||
"gitBranch" TEXT NOT NULL,
|
||||
"gitUsername" TEXT,
|
||||
"gitToken" TEXT,
|
||||
"dockerfilePath" TEXT NOT NULL DEFAULT './Dockerfile',
|
||||
"replicas" INTEGER NOT NULL DEFAULT 1,
|
||||
"envVars" TEXT NOT NULL,
|
||||
"memoryReservation" INTEGER,
|
||||
"memoryLimit" INTEGER,
|
||||
"cpuReservation" INTEGER,
|
||||
"cpuLimit" INTEGER,
|
||||
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
"updatedAt" DATETIME NOT NULL,
|
||||
CONSTRAINT "App_projectId_fkey" FOREIGN KEY ("projectId") REFERENCES "Project" ("id") ON DELETE RESTRICT ON UPDATE CASCADE
|
||||
);
|
||||
|
||||
-- CreateTable
|
||||
CREATE TABLE "AppDomain" (
|
||||
"hostname" TEXT NOT NULL,
|
||||
"port" INTEGER NOT NULL,
|
||||
"useSsl" BOOLEAN NOT NULL DEFAULT true,
|
||||
"appId" TEXT NOT NULL,
|
||||
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
"updatedAt" DATETIME NOT NULL,
|
||||
|
||||
PRIMARY KEY ("hostname", "appId"),
|
||||
CONSTRAINT "AppDomain_appId_fkey" FOREIGN KEY ("appId") REFERENCES "App" ("id") ON DELETE RESTRICT ON UPDATE CASCADE
|
||||
);
|
||||
|
||||
-- CreateTable
|
||||
CREATE TABLE "AppVolume" (
|
||||
"containerMountPath" TEXT NOT NULL,
|
||||
"appId" TEXT NOT NULL,
|
||||
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
"updatedAt" DATETIME NOT NULL,
|
||||
|
||||
PRIMARY KEY ("containerMountPath", "appId"),
|
||||
CONSTRAINT "AppVolume_appId_fkey" FOREIGN KEY ("appId") REFERENCES "App" ("id") ON DELETE RESTRICT ON UPDATE CASCADE
|
||||
);
|
||||
@@ -111,3 +111,63 @@ model Authenticator {
|
||||
}
|
||||
|
||||
// *** 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])
|
||||
|
||||
gitUrl String
|
||||
gitBranch String
|
||||
gitUsername String?
|
||||
gitToken String?
|
||||
dockerfilePath String @default("./Dockerfile")
|
||||
|
||||
replicas Int @default(1)
|
||||
envVars String
|
||||
|
||||
memoryReservation Int?
|
||||
memoryLimit Int?
|
||||
cpuReservation Int?
|
||||
cpuLimit Int?
|
||||
|
||||
appDomains AppDomain[]
|
||||
appVolumes AppVolume[]
|
||||
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
}
|
||||
|
||||
model AppDomain {
|
||||
hostname String
|
||||
port Int
|
||||
useSsl Boolean @default(true)
|
||||
appId String
|
||||
app App @relation(fields: [appId], references: [id])
|
||||
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
|
||||
@@id([hostname, appId])
|
||||
}
|
||||
|
||||
model AppVolume {
|
||||
containerMountPath String
|
||||
appId String
|
||||
app App @relation(fields: [appId], references: [id])
|
||||
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
|
||||
@@id([containerMountPath, appId])
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user