feat: 시계 reconciliation 워커와 명령 경계 완성
This commit is contained in:
@@ -63,23 +63,27 @@ enum InputEventTarget {
|
||||
}
|
||||
|
||||
model InputEvent {
|
||||
sequence BigInt @id @default(autoincrement())
|
||||
requestId String @unique @map("request_id")
|
||||
target InputEventTarget
|
||||
eventType String @map("event_type")
|
||||
payload Json @default(dbgenerated("'{}'::jsonb"))
|
||||
actorUserId String? @map("actor_user_id")
|
||||
acceptedGameTick BigInt? @map("accepted_game_tick")
|
||||
acceptedClockRevision BigInt? @map("accepted_clock_revision")
|
||||
status InputEventStatus @default(PENDING)
|
||||
result Json?
|
||||
error String?
|
||||
attempts Int @default(0)
|
||||
lockedBy String? @map("locked_by")
|
||||
leaseUntil DateTime? @map("lease_until")
|
||||
createdAt DateTime @default(now()) @map("created_at")
|
||||
processingAt DateTime? @map("processing_at")
|
||||
completedAt DateTime? @map("completed_at")
|
||||
sequence BigInt @id @default(autoincrement())
|
||||
requestId String @unique @map("request_id")
|
||||
target InputEventTarget
|
||||
eventType String @map("event_type")
|
||||
payload Json @default(dbgenerated("'{}'::jsonb"))
|
||||
actorUserId String? @map("actor_user_id")
|
||||
acceptedGameTick BigInt? @map("accepted_game_tick")
|
||||
acceptedClockRevision BigInt? @map("accepted_clock_revision")
|
||||
acceptedDeadlineGeneration BigInt? @map("accepted_deadline_generation")
|
||||
processingGameTick BigInt? @map("processing_game_tick")
|
||||
processingClockRevision BigInt? @map("processing_clock_revision")
|
||||
processingDeadlineGeneration BigInt? @map("processing_deadline_generation")
|
||||
status InputEventStatus @default(PENDING)
|
||||
result Json?
|
||||
error String?
|
||||
attempts Int @default(0)
|
||||
lockedBy String? @map("locked_by")
|
||||
leaseUntil DateTime? @map("lease_until")
|
||||
createdAt DateTime @default(now()) @map("created_at")
|
||||
processingAt DateTime? @map("processing_at")
|
||||
completedAt DateTime? @map("completed_at")
|
||||
|
||||
@@index([target, status, sequence])
|
||||
@@map("input_event")
|
||||
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
ALTER TABLE input_event
|
||||
ADD COLUMN accepted_deadline_generation BIGINT,
|
||||
ADD COLUMN processing_game_tick BIGINT,
|
||||
ADD COLUMN processing_clock_revision BIGINT,
|
||||
ADD COLUMN processing_deadline_generation BIGINT;
|
||||
|
||||
ALTER TABLE input_event
|
||||
ADD CONSTRAINT input_event_accepted_clock_revision_positive
|
||||
CHECK (accepted_clock_revision IS NULL OR accepted_clock_revision > 0),
|
||||
ADD CONSTRAINT input_event_accepted_deadline_generation_positive
|
||||
CHECK (accepted_deadline_generation IS NULL OR accepted_deadline_generation > 0),
|
||||
ADD CONSTRAINT input_event_processing_clock_revision_positive
|
||||
CHECK (processing_clock_revision IS NULL OR processing_clock_revision > 0),
|
||||
ADD CONSTRAINT input_event_processing_deadline_generation_positive
|
||||
CHECK (processing_deadline_generation IS NULL OR processing_deadline_generation > 0);
|
||||
Reference in New Issue
Block a user