Merge branch 'codex/p0-general-turn-lifecycle'
# Conflicts: # app/game-engine/src/turn/databaseHooks.ts # app/game-engine/src/turn/inMemoryWorld.ts # app/game-engine/src/turn/reservedTurnHandler.ts # packages/infra/src/turnEngineDb.ts
This commit is contained in:
@@ -179,6 +179,20 @@ model General {
|
||||
@@map("general")
|
||||
}
|
||||
|
||||
model GeneralAccessLog {
|
||||
id Int @id @default(autoincrement())
|
||||
generalId Int @unique @map("general_id")
|
||||
userId String? @map("user_id")
|
||||
lastRefresh DateTime? @map("last_refresh")
|
||||
refresh Int @default(0)
|
||||
refreshTotal Int @default(0) @map("refresh_total")
|
||||
refreshScore Int @default(0) @map("refresh_score")
|
||||
refreshScoreTotal Int @default(0) @map("refresh_score_total")
|
||||
|
||||
@@index([userId])
|
||||
@@map("general_access_log")
|
||||
}
|
||||
|
||||
model RankData {
|
||||
id Int @id @default(autoincrement())
|
||||
nationId Int @default(0) @map("nation_id")
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
CREATE TABLE "general_access_log" (
|
||||
"id" SERIAL PRIMARY KEY,
|
||||
"general_id" INTEGER NOT NULL,
|
||||
"user_id" TEXT,
|
||||
"last_refresh" TIMESTAMP(3),
|
||||
"refresh" INTEGER NOT NULL DEFAULT 0,
|
||||
"refresh_total" INTEGER NOT NULL DEFAULT 0,
|
||||
"refresh_score" INTEGER NOT NULL DEFAULT 0,
|
||||
"refresh_score_total" INTEGER NOT NULL DEFAULT 0
|
||||
);
|
||||
|
||||
CREATE UNIQUE INDEX "general_access_log_general_id_key" ON "general_access_log"("general_id");
|
||||
CREATE INDEX "general_access_log_user_id_idx" ON "general_access_log"("user_id");
|
||||
@@ -6,6 +6,7 @@ export interface DatabaseClient {
|
||||
$executeRaw: GamePrismaClient['$executeRaw'];
|
||||
worldState: GamePrisma.WorldStateDelegate;
|
||||
general: GamePrisma.GeneralDelegate;
|
||||
generalAccessLog: GamePrisma.GeneralAccessLogDelegate;
|
||||
city: GamePrisma.CityDelegate;
|
||||
nation: GamePrisma.NationDelegate;
|
||||
diplomacy: GamePrisma.DiplomacyDelegate;
|
||||
|
||||
@@ -16,6 +16,7 @@ export interface TurnEngineWorldStateRow {
|
||||
|
||||
export interface TurnEngineGeneralRow {
|
||||
id: number;
|
||||
userId: string | null;
|
||||
name: string;
|
||||
nationId: number;
|
||||
cityId: number;
|
||||
@@ -43,6 +44,9 @@ export interface TurnEngineGeneralRow {
|
||||
age: number;
|
||||
npcState: number;
|
||||
lastTurn: JsonValue;
|
||||
bornYear: number;
|
||||
deadYear: number;
|
||||
affinity: number | null;
|
||||
meta: JsonValue;
|
||||
turnTime: Date;
|
||||
recentWarTime: Date | null;
|
||||
@@ -142,6 +146,7 @@ export interface TurnEngineWorldStateCreateInput {
|
||||
}
|
||||
|
||||
export interface TurnEngineGeneralUpdateInput {
|
||||
userId: string | null;
|
||||
name: string;
|
||||
nationId: number;
|
||||
cityId: number;
|
||||
@@ -268,6 +273,7 @@ export interface TurnEngineNationUpdateInput {
|
||||
name: string;
|
||||
color: string;
|
||||
capitalCityId: number | null;
|
||||
chiefGeneralId: number | null;
|
||||
gold: number;
|
||||
rice: number;
|
||||
level: number;
|
||||
|
||||
Reference in New Issue
Block a user