Summary: - Fix Prompt list API response schema missing activeVersion and draftVersion fields - Fastify was filtering out undefined schema fields, causing version columns to show empty - Add detailed diagnostic logging for Prompt debug mode troubleshooting - Verify debug mode works correctly (DRAFT version is used when debug enabled) Changes: - backend/src/common/prompt/prompt.routes.ts: Add activeVersion and draftVersion to response schema - backend/src/common/prompt/prompt.service.ts: Add diagnostic logs for setDebugMode and get methods - PKB module: Various authentication and document handling fixes from previous session Tested: Debug mode verified working - v2 DRAFT version correctly loaded when debug enabled
39 lines
1016 B
TypeScript
39 lines
1016 B
TypeScript
import { PrismaClient } from '@prisma/client';
|
|
|
|
const prisma = new PrismaClient();
|
|
|
|
async function main() {
|
|
const cols: any[] = await prisma.$queryRaw`
|
|
SELECT column_name, data_type, is_nullable
|
|
FROM information_schema.columns
|
|
WHERE table_schema = 'platform_schema' AND table_name = 'queue'
|
|
ORDER BY ordinal_position
|
|
`;
|
|
|
|
console.log('platform_schema.queue 表的列:');
|
|
cols.forEach(c => console.log(` ${c.column_name}: ${c.data_type} ${c.is_nullable === 'NO' ? 'NOT NULL' : ''}`));
|
|
|
|
// 检查必要的列是否存在
|
|
const requiredCols = ['table_name', 'partition', 'retention_seconds', 'warning_queued'];
|
|
const existingCols = cols.map(c => c.column_name);
|
|
|
|
console.log('\n检查 create_queue 函数需要的列:');
|
|
for (const col of requiredCols) {
|
|
if (existingCols.includes(col)) {
|
|
console.log(` ✅ ${col} 存在`);
|
|
} else {
|
|
console.log(` ❌ ${col} 缺失!`);
|
|
}
|
|
}
|
|
}
|
|
|
|
main()
|
|
.catch(console.error)
|
|
.finally(() => prisma.$disconnect());
|
|
|
|
|
|
|
|
|
|
|
|
|