Really huge mass update; Getting everything up-to-spec and implementing a wide range of features
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
-- AlterTable
|
||||
ALTER TABLE "Preview" ADD COLUMN "accumulatedCostUsd" DOUBLE PRECISION NOT NULL DEFAULT 0,
|
||||
ADD COLUMN "instanceLaunchedAt" TIMESTAMP(3),
|
||||
ADD COLUMN "instanceType" VARCHAR(64);
|
||||
@@ -0,0 +1,2 @@
|
||||
-- AlterTable
|
||||
ALTER TABLE "RepoConfig" ADD COLUMN "disabledCommands" TEXT[] NOT NULL DEFAULT ARRAY[]::TEXT[];
|
||||
@@ -0,0 +1,2 @@
|
||||
-- AlterTable
|
||||
ALTER TABLE "Preview" ADD COLUMN "stopReason" VARCHAR(128);
|
||||
@@ -0,0 +1,10 @@
|
||||
ALTER TABLE "RepoConfig" ALTER COLUMN "instanceType" SET DEFAULT 't3.medium';
|
||||
ALTER TABLE "AdminSettings" ALTER COLUMN "defaultInstanceType" SET DEFAULT 't3.medium';
|
||||
|
||||
UPDATE "RepoConfig"
|
||||
SET "instanceType" = 't3.medium'
|
||||
WHERE "instanceType" = 't2.medium';
|
||||
|
||||
UPDATE "AdminSettings"
|
||||
SET "defaultInstanceType" = 't3.medium'
|
||||
WHERE "defaultInstanceType" = 't2.medium';
|
||||
@@ -0,0 +1,6 @@
|
||||
ALTER TABLE "RepoConfig" ADD COLUMN "preinstallTools" TEXT[] NOT NULL DEFAULT ARRAY[]::TEXT[];
|
||||
ALTER TABLE "RepoConfig" ADD COLUMN "nodeVersion" VARCHAR(64);
|
||||
|
||||
UPDATE "RepoConfig"
|
||||
SET "preinstallTools" = ARRAY['docker', 'node']::TEXT[],
|
||||
"nodeVersion" = 'lts/*';
|
||||
+17
-2
@@ -73,10 +73,15 @@ model RepoConfig {
|
||||
giteaWebhookId String? @db.VarChar(128)
|
||||
|
||||
denyList String[]
|
||||
instanceType String @default("t2.medium") @db.VarChar(64)
|
||||
// Names of `/pp` commands the operator has switched off for this repo
|
||||
// (e.g. ["stop", "ignore"]). `help` is always available. See routes/webhook.ts.
|
||||
disabledCommands String[]
|
||||
instanceType String @default("t3.medium") @db.VarChar(64)
|
||||
inactivityHours Float @default(12)
|
||||
port Int @default(3000)
|
||||
envVars Json @default("{}")
|
||||
preinstallTools String[] @default([])
|
||||
nodeVersion String? @db.VarChar(64)
|
||||
useDockerCompose Boolean @default(false)
|
||||
composeFilePath String? @db.VarChar(512)
|
||||
aptPackages String[]
|
||||
@@ -103,7 +108,17 @@ model Preview {
|
||||
instanceId String? @db.VarChar(64)
|
||||
instanceIp String? @db.VarChar(64)
|
||||
port Int @default(3000)
|
||||
// Cost tracking. `instanceType` snapshots the type of the currently- (or
|
||||
// last-) launched instance so pricing is accurate even if the RepoConfig
|
||||
// changes later. `instanceLaunchedAt` marks when the live EC2 started billing
|
||||
// (nulled on stop). `accumulatedCostUsd` holds the finalized cost of all
|
||||
// previously-terminated instance sessions for this preview; the live session's
|
||||
// cost is added on top at read time. See lib/cost.ts.
|
||||
instanceType String? @db.VarChar(64)
|
||||
instanceLaunchedAt DateTime?
|
||||
accumulatedCostUsd Float @default(0)
|
||||
status PreviewStatus @default(PROVISIONING)
|
||||
stopReason String? @db.VarChar(128)
|
||||
logs String @default("") @db.Text
|
||||
pid Int?
|
||||
sshPrivateKey String? @db.Text
|
||||
@@ -152,7 +167,7 @@ model NoConfigComment {
|
||||
|
||||
model AdminSettings {
|
||||
id Int @id @default(1)
|
||||
defaultInstanceType String @default("t2.medium") @db.VarChar(64)
|
||||
defaultInstanceType String @default("t3.medium") @db.VarChar(64)
|
||||
maxConcurrentInstancesPerUser Int @default(5)
|
||||
logSizeLimitBytes Int @default(1048576)
|
||||
previewRetentionDays Int @default(30)
|
||||
|
||||
Reference in New Issue
Block a user