Merge branch 'main' into feature/user-icon-library-20260801
This commit is contained in:
+47
@@ -0,0 +1,47 @@
|
||||
ALTER TYPE "GatewayOperationType" ADD VALUE IF NOT EXISTS 'DEPLOY';
|
||||
|
||||
CREATE TYPE "GatewayReleaseOperationType" AS ENUM ('DEPLOY', 'ROLLBACK');
|
||||
|
||||
CREATE TABLE "gateway_release_state" (
|
||||
"id" TEXT NOT NULL DEFAULT 'gateway',
|
||||
"active_commit_sha" TEXT,
|
||||
"active_workspace" TEXT,
|
||||
"previous_commit_sha" TEXT,
|
||||
"previous_workspace" TEXT,
|
||||
"last_successful_at" TIMESTAMP(3),
|
||||
"last_error" TEXT,
|
||||
"updated_at" TIMESTAMP(3) NOT NULL,
|
||||
|
||||
CONSTRAINT "gateway_release_state_pkey" PRIMARY KEY ("id")
|
||||
);
|
||||
|
||||
CREATE TABLE "gateway_release_operation" (
|
||||
"id" TEXT NOT NULL,
|
||||
"type" "GatewayReleaseOperationType" NOT NULL,
|
||||
"status" "GatewayOperationStatus" NOT NULL DEFAULT 'QUEUED',
|
||||
"source_mode" "GatewaySourceMode",
|
||||
"source_ref" TEXT,
|
||||
"resolved_commit_sha" TEXT,
|
||||
"payload" JSONB NOT NULL DEFAULT '{}'::jsonb,
|
||||
"reason" TEXT,
|
||||
"requested_by" TEXT NOT NULL,
|
||||
"started_at" TIMESTAMP(3),
|
||||
"completed_at" TIMESTAMP(3),
|
||||
"error" TEXT,
|
||||
"lease_owner" TEXT,
|
||||
"lease_until" TIMESTAMPTZ,
|
||||
"heartbeat_at" TIMESTAMPTZ,
|
||||
"attempts" INTEGER NOT NULL DEFAULT 0,
|
||||
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
"updated_at" TIMESTAMP(3) NOT NULL,
|
||||
|
||||
CONSTRAINT "gateway_release_operation_pkey" PRIMARY KEY ("id")
|
||||
);
|
||||
|
||||
CREATE INDEX "gateway_release_operation_status_lease_until_created_at_idx"
|
||||
ON "gateway_release_operation" ("status", "lease_until", "created_at");
|
||||
CREATE INDEX "gateway_release_operation_created_at_idx"
|
||||
ON "gateway_release_operation" ("created_at");
|
||||
CREATE UNIQUE INDEX "gateway_release_operation_one_active_idx"
|
||||
ON "gateway_release_operation" ((1))
|
||||
WHERE "status" IN ('QUEUED', 'RUNNING');
|
||||
@@ -33,10 +33,16 @@ enum GatewayBuildStatus {
|
||||
|
||||
enum GatewayOperationType {
|
||||
RESET
|
||||
DEPLOY
|
||||
START
|
||||
STOP
|
||||
}
|
||||
|
||||
enum GatewayReleaseOperationType {
|
||||
DEPLOY
|
||||
ROLLBACK
|
||||
}
|
||||
|
||||
enum GatewayOperationStatus {
|
||||
QUEUED
|
||||
RUNNING
|
||||
@@ -219,6 +225,46 @@ model GatewayOperation {
|
||||
@@map("gateway_operation")
|
||||
}
|
||||
|
||||
model GatewayReleaseState {
|
||||
id String @id @default("gateway")
|
||||
activeCommitSha String? @map("active_commit_sha")
|
||||
activeWorkspace String? @map("active_workspace")
|
||||
previousCommitSha String? @map("previous_commit_sha")
|
||||
previousWorkspace String? @map("previous_workspace")
|
||||
lastSuccessfulAt DateTime? @map("last_successful_at")
|
||||
lastError String? @map("last_error")
|
||||
updatedAt DateTime @updatedAt @map("updated_at")
|
||||
|
||||
@@map("gateway_release_state")
|
||||
}
|
||||
|
||||
model GatewayReleaseOperation {
|
||||
/// A partial unique index in the gateway migration chain permits only one
|
||||
/// QUEUED or RUNNING control-plane release at a time.
|
||||
id String @id @default(uuid())
|
||||
type GatewayReleaseOperationType
|
||||
status GatewayOperationStatus @default(QUEUED)
|
||||
sourceMode GatewaySourceMode? @map("source_mode")
|
||||
sourceRef String? @map("source_ref")
|
||||
resolvedCommitSha String? @map("resolved_commit_sha")
|
||||
payload Json @default(dbgenerated("'{}'::jsonb"))
|
||||
reason String?
|
||||
requestedBy String @map("requested_by")
|
||||
startedAt DateTime? @map("started_at")
|
||||
completedAt DateTime? @map("completed_at")
|
||||
error String?
|
||||
leaseOwner String? @map("lease_owner")
|
||||
leaseUntil DateTime? @map("lease_until")
|
||||
heartbeatAt DateTime? @map("heartbeat_at")
|
||||
attempts Int @default(0)
|
||||
createdAt DateTime @default(now()) @map("created_at")
|
||||
updatedAt DateTime @updatedAt @map("updated_at")
|
||||
|
||||
@@index([status, leaseUntil, createdAt])
|
||||
@@index([createdAt])
|
||||
@@map("gateway_release_operation")
|
||||
}
|
||||
|
||||
model SystemSetting {
|
||||
id Int @id @default(1) @map("no")
|
||||
registrationEnabled Boolean @default(false) @map("registration_enabled")
|
||||
|
||||
Reference in New Issue
Block a user