feat: 과거 장수 전투 결과 보존 이관 추가
preserved batres 파일을 기수 단위로 검증·체크포인트하고 과거 장수 상세에 연결한다. check-plan에는 전체 이전 항목과 정보 설명을 함께 노출한다.
This commit is contained in:
@@ -36,6 +36,12 @@ export interface LegacyGeneralRow {
|
||||
data: unknown;
|
||||
}
|
||||
|
||||
export interface LegacyGeneralBattleResultRow {
|
||||
content: string;
|
||||
lineCount: number;
|
||||
contentHash: string;
|
||||
}
|
||||
|
||||
export interface LegacyNationRow {
|
||||
sourceProfile: LegacyArchiveProfile;
|
||||
legacyId: number;
|
||||
@@ -120,6 +126,24 @@ export const findLegacyGeneral = async (
|
||||
return rows[0] ?? null;
|
||||
};
|
||||
|
||||
export const findLegacyGeneralBattleResult = async (
|
||||
db: LegacyArchiveDatabase,
|
||||
input: { sourceProfile: LegacyArchiveProfile; serverId: string; generalNo: number }
|
||||
): Promise<LegacyGeneralBattleResultRow | null> => {
|
||||
const rows = await db.$queryRaw<LegacyGeneralBattleResultRow[]>(GamePrisma.sql`
|
||||
SELECT
|
||||
"content",
|
||||
"line_count" AS "lineCount",
|
||||
"content_hash" AS "contentHash"
|
||||
FROM "legacy_archive"."general_battle_result"
|
||||
WHERE "source_profile" = ${input.sourceProfile}
|
||||
AND "server_id" = ${input.serverId}
|
||||
AND "general_no" = ${input.generalNo}
|
||||
LIMIT 1
|
||||
`);
|
||||
return rows[0] ?? null;
|
||||
};
|
||||
|
||||
export const findLegacyGeneralsForServer = async (
|
||||
db: LegacyArchiveDatabase,
|
||||
input: { sourceProfile: LegacyArchiveProfile; serverId: string; generalNos: number[] }
|
||||
|
||||
Reference in New Issue
Block a user