feat(gateway): persist profile operation build logs
This commit is contained in:
+18
@@ -0,0 +1,18 @@
|
||||
CREATE TABLE "gateway_operation_log" (
|
||||
"id" BIGSERIAL NOT NULL,
|
||||
"operation_id" TEXT NOT NULL,
|
||||
"level" TEXT NOT NULL,
|
||||
"phase" TEXT NOT NULL,
|
||||
"message" TEXT NOT NULL,
|
||||
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
|
||||
CONSTRAINT "gateway_operation_log_pkey" PRIMARY KEY ("id")
|
||||
);
|
||||
|
||||
CREATE INDEX "gateway_operation_log_operation_id_id_idx"
|
||||
ON "gateway_operation_log"("operation_id", "id");
|
||||
|
||||
ALTER TABLE "gateway_operation_log"
|
||||
ADD CONSTRAINT "gateway_operation_log_operation_id_fkey"
|
||||
FOREIGN KEY ("operation_id") REFERENCES "gateway_operation"("id")
|
||||
ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
@@ -280,6 +280,7 @@ model GatewayOperation {
|
||||
attempts Int @default(0)
|
||||
createdAt DateTime @default(now()) @map("created_at")
|
||||
updatedAt DateTime @updatedAt @map("updated_at")
|
||||
logs GatewayOperationLog[]
|
||||
|
||||
@@index([status, scheduledAt, createdAt])
|
||||
@@index([status, leaseUntil, createdAt])
|
||||
@@ -287,6 +288,19 @@ model GatewayOperation {
|
||||
@@map("gateway_operation")
|
||||
}
|
||||
|
||||
model GatewayOperationLog {
|
||||
id BigInt @id @default(autoincrement())
|
||||
operationId String @map("operation_id")
|
||||
level String
|
||||
phase String
|
||||
message String @db.Text
|
||||
createdAt DateTime @default(now()) @map("created_at")
|
||||
operation GatewayOperation @relation(fields: [operationId], references: [id], onDelete: Cascade)
|
||||
|
||||
@@index([operationId, id])
|
||||
@@map("gateway_operation_log")
|
||||
}
|
||||
|
||||
model GatewayReleaseState {
|
||||
id String @id @default("gateway")
|
||||
activeCommitSha String? @map("active_commit_sha")
|
||||
|
||||
Reference in New Issue
Block a user