Major Changes: - Database: Install pg_bigm/pgvector plugins, create test database - Python service: v1.0 -> v1.1, add pymupdf4llm/openpyxl/pypandoc - Node.js backend: v1.3 -> v1.7, fix pino-pretty and ES Module imports - Frontend: v1.2 -> v1.3, skip TypeScript check for deployment - Code recovery: Restore empty files from local backup Technical Fixes: - Fix pino-pretty error in production (conditional loading) - Fix ES Module import paths (add .js extensions) - Fix OSSAdapter TypeScript errors - Update Prisma Schema (63 models, 16 schemas) - Update environment variables (DATABASE_URL, EXTRACTION_SERVICE_URL, OSS) - Remove deprecated variables (REDIS_URL, DIFY_API_URL, DIFY_API_KEY) Documentation: - Create 0126 deployment folder with 8 documents - Update database development standards v2.0 - Update SAE deployment status records Deployment Status: - PostgreSQL: ai_clinical_research_test with plugins - Python: v1.1 @ 172.17.173.84:8000 - Backend: v1.7 @ 172.17.173.89:3001 - Frontend: v1.3 @ 172.17.173.90:80 Tested: All services running successfully on SAE
99 lines
2.5 KiB
TypeScript
99 lines
2.5 KiB
TypeScript
import { PrismaClient } from '@prisma/client';
|
|
|
|
const prisma = new PrismaClient();
|
|
|
|
async function main() {
|
|
console.log('🔍 检查 RVW 模块问题\n');
|
|
|
|
// 1. 检查用户 user-mock-001 是否存在
|
|
console.log('1. 检查用户 "user-mock-001":');
|
|
const users: any[] = await prisma.$queryRaw`
|
|
SELECT id, name, email, phone, role
|
|
FROM platform_schema.users
|
|
WHERE id = 'user-mock-001' OR email LIKE '%mock%' OR name LIKE '%mock%'
|
|
`;
|
|
|
|
if (users.length === 0) {
|
|
console.log(' ❌ 用户 "user-mock-001" 不存在!');
|
|
} else {
|
|
console.log(' ✅ 找到用户:');
|
|
users.forEach(u => console.log(` ${u.id}: ${u.name} (${u.email || u.phone})`));
|
|
}
|
|
|
|
// 2. 检查所有用户
|
|
console.log('\n2. 当前所有用户:');
|
|
const allUsers: any[] = await prisma.$queryRaw`
|
|
SELECT id, name, phone, role FROM platform_schema.users
|
|
`;
|
|
allUsers.forEach(u => console.log(` - ${u.id}: ${u.name} (${u.phone}) [${u.role}]`));
|
|
|
|
// 3. 检查 rvw_schema.review_tasks 表结构
|
|
console.log('\n3. rvw_schema.review_tasks 表结构:');
|
|
const cols: any[] = await prisma.$queryRaw`
|
|
SELECT column_name, data_type, is_nullable, column_default
|
|
FROM information_schema.columns
|
|
WHERE table_schema = 'rvw_schema' AND table_name = 'review_tasks'
|
|
ORDER BY ordinal_position
|
|
`;
|
|
cols.forEach(c => {
|
|
const nullable = c.is_nullable === 'YES' ? 'NULLABLE' : 'NOT NULL';
|
|
console.log(` ${c.column_name}: ${c.data_type} ${nullable}`);
|
|
});
|
|
|
|
// 4. 检查外键约束
|
|
console.log('\n4. review_tasks 的外键约束:');
|
|
const fks: any[] = await prisma.$queryRaw`
|
|
SELECT
|
|
tc.constraint_name,
|
|
kcu.column_name,
|
|
ccu.table_schema AS foreign_table_schema,
|
|
ccu.table_name AS foreign_table_name,
|
|
ccu.column_name AS foreign_column_name
|
|
FROM information_schema.table_constraints AS tc
|
|
JOIN information_schema.key_column_usage AS kcu
|
|
ON tc.constraint_name = kcu.constraint_name
|
|
JOIN information_schema.constraint_column_usage AS ccu
|
|
ON ccu.constraint_name = tc.constraint_name
|
|
WHERE tc.constraint_type = 'FOREIGN KEY'
|
|
AND tc.table_schema = 'rvw_schema'
|
|
AND tc.table_name = 'review_tasks'
|
|
`;
|
|
|
|
if (fks.length === 0) {
|
|
console.log(' 无外键约束');
|
|
} else {
|
|
fks.forEach(fk => {
|
|
console.log(` ${fk.column_name} -> ${fk.foreign_table_schema}.${fk.foreign_table_name}.${fk.foreign_column_name}`);
|
|
});
|
|
}
|
|
}
|
|
|
|
main()
|
|
.catch(console.error)
|
|
.finally(() => prisma.$disconnect());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|