feat: 연감 기능 추가 및 데이터베이스 모델 생성
This commit is contained in:
@@ -213,6 +213,21 @@ model DiplomacyLetter {
|
||||
@@map("diplomacy_letter")
|
||||
}
|
||||
|
||||
model YearbookHistory {
|
||||
id Int @id @default(autoincrement())
|
||||
profileName String @map("profile_name")
|
||||
year Int
|
||||
month Int
|
||||
map Json
|
||||
nations Json
|
||||
hash String @default("")
|
||||
createdAt DateTime @default(now()) @map("created_at")
|
||||
|
||||
@@unique([profileName, year, month])
|
||||
@@index([profileName, year, month])
|
||||
@@map("yearbook_history")
|
||||
}
|
||||
|
||||
model Event {
|
||||
id Int @id @default(autoincrement())
|
||||
targetCode String @map("target_code")
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
CREATE TABLE "yearbook_history" (
|
||||
"id" SERIAL PRIMARY KEY,
|
||||
"profile_name" TEXT NOT NULL,
|
||||
"year" INTEGER NOT NULL,
|
||||
"month" INTEGER NOT NULL,
|
||||
"map" JSONB NOT NULL,
|
||||
"nations" JSONB NOT NULL,
|
||||
"hash" TEXT NOT NULL DEFAULT '',
|
||||
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP
|
||||
);
|
||||
|
||||
CREATE UNIQUE INDEX "yearbook_history_profile_year_month_key" ON "yearbook_history"("profile_name", "year", "month");
|
||||
CREATE INDEX "yearbook_history_profile_year_month_idx" ON "yearbook_history"("profile_name", "year", "month");
|
||||
@@ -10,6 +10,7 @@ export interface DatabaseClient {
|
||||
nation: GamePrisma.NationDelegate;
|
||||
diplomacy: GamePrisma.DiplomacyDelegate;
|
||||
diplomacyLetter: GamePrisma.DiplomacyLetterDelegate;
|
||||
yearbookHistory: GamePrisma.YearbookHistoryDelegate;
|
||||
generalTurn: GamePrisma.GeneralTurnDelegate;
|
||||
nationTurn: GamePrisma.NationTurnDelegate;
|
||||
troop: GamePrisma.TroopDelegate;
|
||||
|
||||
Reference in New Issue
Block a user