feat: 예약 초기화 중간 버전 업데이트를 허용한다
미래 예약 RESET을 보존하면서 DB 유지 DEPLOY 한 건을 별도 queue lane에 등록한다. 예약 시각까지 시작되지 않은 중간 배포는 RESET claim 전에 자동 취소하고 관리자 화면에 이 경계를 안내한다.
This commit is contained in:
+19
@@ -0,0 +1,19 @@
|
||||
-- Keep the opening RESET reservation while allowing exactly one immediate
|
||||
-- operation (the application permits only DEPLOY) beside it. A single RUNNING
|
||||
-- lane preserves the existing profile mutation serialization contract.
|
||||
DROP INDEX "gateway_operation_one_active_per_profile_idx";
|
||||
|
||||
CREATE UNIQUE INDEX "gateway_operation_one_running_per_profile_idx"
|
||||
ON "gateway_operation" ("profile_name")
|
||||
WHERE "status" = 'RUNNING';
|
||||
|
||||
CREATE UNIQUE INDEX "gateway_operation_one_queued_scheduled_reset_per_profile_idx"
|
||||
ON "gateway_operation" ("profile_name")
|
||||
WHERE "status" = 'QUEUED'
|
||||
AND "type" = 'RESET'
|
||||
AND "scheduled_at" IS NOT NULL;
|
||||
|
||||
CREATE UNIQUE INDEX "gateway_operation_one_queued_immediate_per_profile_idx"
|
||||
ON "gateway_operation" ("profile_name")
|
||||
WHERE "status" = 'QUEUED'
|
||||
AND NOT ("type" = 'RESET' AND "scheduled_at" IS NOT NULL);
|
||||
@@ -362,8 +362,9 @@ model GatewayRuntimeAction {
|
||||
}
|
||||
|
||||
model GatewayOperation {
|
||||
/// A partial unique index in the gateway migration chain permits only one
|
||||
/// QUEUED or RUNNING operation per profile.
|
||||
/// Partial unique indexes in the gateway migration chain permit one future
|
||||
/// scheduled RESET beside one immediate queued operation. RUNNING work and
|
||||
/// each queue lane remain unique per profile.
|
||||
id String @id @default(uuid())
|
||||
profileName String @map("profile_name")
|
||||
profile GatewayProfile @relation(fields: [profileName], references: [profileName], onDelete: Cascade)
|
||||
|
||||
Reference in New Issue
Block a user