chore(api): temporary boot-time data diagnostics in the container log
Prints aggregate counts only, prefixed [DIAG], right after migrations: customers by kind/active/archived/step, what the omde list can show and how many rows are sales-expert trading accounts (created vs adopted), experts' profile/trading state, referral counts, the Admin table and the last applied migrations. Read-only, no mobile/name/id is printed, each query isolated so a failure is reported without stopping boot. Disable with DIAG_LOG=false; remove once the empty-omde-list investigation is closed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
ee43d664d5
commit
ab39f6abed
@@ -4,6 +4,7 @@ import { join } from 'path';
|
||||
import { promisify } from 'util';
|
||||
import { Logger } from '@nestjs/common';
|
||||
import { PrismaClient } from '@prisma/client';
|
||||
import { logDataDiagnostics } from './diagnostics';
|
||||
import { runMigrations, runOnce } from './migrate';
|
||||
|
||||
const execFileAsync = promisify(execFile);
|
||||
@@ -40,6 +41,9 @@ export async function prepareDatabase(): Promise<void> {
|
||||
logger.log('No pending migrations');
|
||||
}
|
||||
|
||||
// TEMPORARY — see diagnostics.ts. Never throws.
|
||||
await logDataDiagnostics(prisma);
|
||||
|
||||
if (process.env.RUN_SEED === 'false') return;
|
||||
|
||||
const seedScript = resolveSeedScript();
|
||||
|
||||
Reference in New Issue
Block a user