Summary: - Migrate PostgreSQL to pgvector/pgvector:pg15 Docker image - Successfully install and verify pgvector 0.8.1 extension - Create comprehensive Dify-to-pgvector migration plan - Update PKB module documentation with pgvector status - Update system documentation with pgvector integration Key changes: - docker-compose.yml: Switch to pgvector/pgvector:pg15 image - Add EkbDocument and EkbChunk data model design - Design R-C-R-G hybrid retrieval architecture - Add clinical data JSONB fields (pico, studyDesign, regimen, safety, criteria, endpoints) - Create detailed 10-day implementation roadmap Documentation updates: - PKB module status: pgvector RAG infrastructure ready - System status: pgvector 0.8.1 integrated - New: Dify replacement development plan (01-Dify替换为pgvector开发计划.md) - New: Enterprise medical knowledge base solution V2 Tested: PostgreSQL with pgvector verified, frontend and backend functionality confirmed
46 lines
1023 B
TypeScript
46 lines
1023 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());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|