feat: fence periodic turn daemon execution
This commit is contained in:
@@ -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")
|
||||
);
|
||||
@@ -27,4 +27,5 @@ export interface DatabaseClient {
|
||||
inheritanceResult: GamePrisma.InheritanceResultDelegate;
|
||||
inheritanceUserState: GamePrisma.InheritanceUserStateDelegate;
|
||||
inputEvent: GamePrisma.InputEventDelegate;
|
||||
turnDaemonLease: GamePrisma.TurnDaemonLeaseDelegate;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user