Summary: - PostgreSQL database migration to RDS completed (90MB SQL, 11 schemas) - Frontend Nginx Docker image built and pushed to ACR (v1.0, ~50MB) - Python microservice Docker image built and pushed to ACR (v1.0, 1.12GB) - Created 3 deployment documentation files Docker Configuration Files: - frontend-v2/Dockerfile: Multi-stage build with nginx:alpine - frontend-v2/.dockerignore: Optimize build context - frontend-v2/nginx.conf: SPA routing and API proxy - frontend-v2/docker-entrypoint.sh: Dynamic env injection - extraction_service/Dockerfile: Multi-stage build with Aliyun Debian mirror - extraction_service/.dockerignore: Optimize build context - extraction_service/requirements-prod.txt: Production dependencies (removed Nougat) Deployment Documentation: - docs/05-部署文档/00-部署进度总览.md: One-stop deployment status overview - docs/05-部署文档/07-前端Nginx-SAE部署操作手册.md: Frontend deployment guide - docs/05-部署文档/08-PostgreSQL数据库部署操作手册.md: Database deployment guide - docs/00-系统总体设计/00-系统当前状态与开发指南.md: Updated with deployment status Database Migration: - RDS instance: pgm-2zex1m2y3r23hdn5 (2C4G, PostgreSQL 15.0) - Database: ai_clinical_research - Schemas: 11 business schemas migrated successfully - Data: 3 users, 2 projects, 1204 literatures verified - Backup: rds_init_20251224_154529.sql (90MB) Docker Images: - Frontend: crpi-cd5ij4pjt65mweeo.cn-beijing.personal.cr.aliyuncs.com/ai-clinical/ai-clinical_frontend-nginx:v1.0 - Python: crpi-cd5ij4pjt65mweeo.cn-beijing.personal.cr.aliyuncs.com/ai-clinical/python-extraction:v1.0 Key Achievements: - Resolved Docker Hub network issues (using generic tags) - Fixed 30 TypeScript compilation errors - Removed Nougat OCR to reduce image size by 1.5GB - Used Aliyun Debian mirror to resolve apt-get network issues - Implemented multi-stage builds for optimization Next Steps: - Deploy Python microservice to SAE - Build Node.js backend Docker image - Deploy Node.js backend to SAE - Deploy frontend Nginx to SAE - End-to-end verification testing Status: Docker images ready, SAE deployment pending
83 lines
2.2 KiB
SQL
83 lines
2.2 KiB
SQL
-- ==================== Postgres-Only 改造:手动迁移 ====================
|
||
-- 文件: 001_add_postgres_cache_and_checkpoint.sql
|
||
-- 目的: 添加缓存表和断点续传字段
|
||
-- 日期: 2025-12-13
|
||
-- 说明: 避免Prisma migrate的shadow database问题,手动添加所需表和字段
|
||
|
||
-- ==================== 1. 创建缓存表 (AppCache) ====================
|
||
|
||
CREATE TABLE IF NOT EXISTS platform_schema.app_cache (
|
||
id SERIAL PRIMARY KEY,
|
||
key VARCHAR(500) UNIQUE NOT NULL,
|
||
value JSONB NOT NULL,
|
||
expires_at TIMESTAMP NOT NULL,
|
||
created_at TIMESTAMP DEFAULT NOW()
|
||
);
|
||
|
||
-- 创建索引(优化过期查询和key查询)
|
||
CREATE INDEX IF NOT EXISTS idx_app_cache_expires
|
||
ON platform_schema.app_cache(expires_at);
|
||
|
||
CREATE INDEX IF NOT EXISTS idx_app_cache_key_expires
|
||
ON platform_schema.app_cache(key, expires_at);
|
||
|
||
-- ==================== 2. 为AslScreeningTask添加新字段 ====================
|
||
|
||
-- 任务拆分支持字段
|
||
ALTER TABLE asl_schema.screening_tasks
|
||
ADD COLUMN IF NOT EXISTS total_batches INTEGER DEFAULT 1,
|
||
ADD COLUMN IF NOT EXISTS processed_batches INTEGER DEFAULT 0,
|
||
ADD COLUMN IF NOT EXISTS current_batch_index INTEGER DEFAULT 0;
|
||
|
||
-- 断点续传支持字段
|
||
ALTER TABLE asl_schema.screening_tasks
|
||
ADD COLUMN IF NOT EXISTS current_index INTEGER DEFAULT 0,
|
||
ADD COLUMN IF NOT EXISTS last_checkpoint TIMESTAMP,
|
||
ADD COLUMN IF NOT EXISTS checkpoint_data JSONB;
|
||
|
||
-- ==================== 3. 验证创建结果 ====================
|
||
|
||
-- 查看app_cache表结构
|
||
SELECT
|
||
column_name,
|
||
data_type,
|
||
is_nullable,
|
||
column_default
|
||
FROM information_schema.columns
|
||
WHERE table_schema = 'platform_schema'
|
||
AND table_name = 'app_cache'
|
||
ORDER BY ordinal_position;
|
||
|
||
-- 查看screening_tasks新增字段
|
||
SELECT
|
||
column_name,
|
||
data_type,
|
||
is_nullable,
|
||
column_default
|
||
FROM information_schema.columns
|
||
WHERE table_schema = 'asl_schema'
|
||
AND table_name = 'screening_tasks'
|
||
AND column_name IN (
|
||
'total_batches', 'processed_batches', 'current_batch_index',
|
||
'current_index', 'last_checkpoint', 'checkpoint_data'
|
||
)
|
||
ORDER BY ordinal_position;
|
||
|
||
-- ==================== 完成 ====================
|
||
-- ✅ 缓存表已创建
|
||
-- ✅ 任务拆分字段已添加
|
||
-- ✅ 断点续传字段已添加
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|