feat: fence periodic turn daemon execution

This commit is contained in:
2026-07-25 09:22:32 +00:00
parent a83f7a44e3
commit 0151055f94
8 changed files with 399 additions and 3 deletions
+10
View File
@@ -77,6 +77,16 @@ model InputEvent {
@@map("input_event")
}
model TurnDaemonLease {
profile String @id
ownerId String @map("owner_id")
leaseUntil DateTime @map("lease_until")
fencingEpoch BigInt @default(1) @map("fencing_epoch")
heartbeatAt DateTime @default(now()) @map("heartbeat_at")
@@map("turn_daemon_lease")
}
model WorldState {
id Int @id @default(autoincrement())
scenarioCode String @map("scenario_code")
@@ -0,0 +1,9 @@
CREATE TABLE "turn_daemon_lease" (
"profile" TEXT NOT NULL,
"owner_id" TEXT NOT NULL,
"lease_until" TIMESTAMP(3) NOT NULL,
"fencing_epoch" BIGINT NOT NULL DEFAULT 1,
"heartbeat_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
CONSTRAINT "turn_daemon_lease_pkey" PRIMARY KEY ("profile")
);
+1
View File
@@ -27,4 +27,5 @@ export interface DatabaseClient {
inheritanceResult: GamePrisma.InheritanceResultDelegate;
inheritanceUserState: GamePrisma.InheritanceUserStateDelegate;
inputEvent: GamePrisma.InputEventDelegate;
turnDaemonLease: GamePrisma.TurnDaemonLeaseDelegate;
}