docs(platform): Add database documentation system and restructure deployment docs

Completed:
- Add 6 core database documents (docs/01-平台基础层/07-数据库/)
  Architecture overview, migration history, environment comparison,
  tech debt tracking, seed data management, PostgreSQL extensions
- Restructure deployment docs: archive 20 legacy files to _archive-2025/
- Create unified daily operations manual (01-日常更新操作手册.md)
- Add pending deployment change tracker (03-待部署变更清单.md)
- Update database development standard to v3.0 (three iron rules)
- Fix Prisma schema type drift: align @db.* annotations with actual DB
  IIT: UUID/Timestamptz(6), SSA: Timestamp(6)/VarChar(20/50/100)
- Add migration: 20260227_align_schema_with_db_types (idempotent ALTER)
- Add Cursor Rule for auto-reminding deployment change documentation
- Update system status guide v6.4 with deployment and DB doc references
- Add architecture consultation docs (Prisma guide, SAE deployment guide)

Technical details:
- Manual migration due to shadow DB limitation (TD-001 in tech debt)
- Deployment docs reduced from 20+ scattered files to 3 core documents
- Cursor Rule triggers on schema.prisma, package.json, Dockerfile changes

Made-with: Cursor
This commit is contained in:
2026-02-27 14:35:25 +08:00
parent 9b8490b4d0
commit 6124c7abc6
48 changed files with 3009 additions and 582 deletions

View File

@@ -1,7 +1,7 @@
# 🚀 AI临床研究平台 - 阿里云SAE最新真实状态记录
> **文档用途**记录阿里云SAE服务器最新真实状态 + 每次部署记录
> **最后更新**2026-01-27 08:05
> **最后更新**2026-02-27
> **维护人员**:开发团队
> **说明**本文档准确记录SAE上所有应用的当前状态包括内网地址、镜像版本、用户名密码等关键资源信息
@@ -11,10 +11,11 @@
| 服务名称 | 部署状态 | 镜像版本 | 部署位置 | 最后更新时间 |
|---------|---------|---------|---------|-------------|
| **PostgreSQL数据库** | ✅ 运行中 | PostgreSQL 15 + 插件 | RDS | 2026-01-27 |
| **前端Nginx服务** | ✅ 运行中 | v1.3 | SAE | 2026-01-27 |
| **Python微服务** | ✅ 运行中 | v1.1 | SAE | 2026-01-26 |
| **Node.js后端** | ✅ 运行中 | v1.7 | SAE | 2026-01-27 |
| **PostgreSQL数据库** | ✅ 运行中 | PostgreSQL 15 + 插件 | RDS | 2026-02-27 |
| **前端Nginx服务** | ✅ 运行中 | **v1.8** | SAE | 2026-02-27 |
| **Python微服务** | ✅ 运行中 | **v1.2** | SAE | 2026-02-27 |
| **Node.js后端** | ✅ 运行中 | **v2.1** | SAE | 2026-02-27 |
| **R统计引擎** | ✅ 运行中 | **v1.0.1** | SAE | 2026-02-27 |
| **Dify AI服务** | ⚠️ 已废弃 | - | - | 使用pgvector替代 |
---
@@ -34,9 +35,10 @@
| 仓库名称 | 最新版本 | 镜像大小 | VPC地址 |
|---------|---------|---------|---------|
| **python-extraction** | v1.0 | 1.12GB | `crpi-cd5ij4pjt65mweeo-vpc.cn-beijing.personal.cr.aliyuncs.com/ai-clinical/python-extraction:v1.0` |
| **ai-clinical_frontend-nginx** | v1.2 | ~50MB | `crpi-cd5ij4pjt65mweeo-vpc.cn-beijing.personal.cr.aliyuncs.com/ai-clinical/ai-clinical_frontend-nginx:v1.2` |
| **backend-service** | v1.3 | 838MB | `crpi-cd5ij4pjt65mweeo-vpc.cn-beijing.personal.cr.aliyuncs.com/ai-clinical/backend-service:v1.3` |
| **python-extraction** | **v1.2** | ~1.1GB | `crpi-cd5ij4pjt65mweeo-vpc.cn-beijing.personal.cr.aliyuncs.com/ai-clinical/python-extraction:v1.2` |
| **ssa-r-statistics** | **v1.0.1** | ~1.8GB | `crpi-cd5ij4pjt65mweeo-vpc.cn-beijing.personal.cr.aliyuncs.com/ai-clinical/ssa-r-statistics:v1.0.1` |
| **ai-clinical_frontend-nginx** | v1.3 | ~50MB | `crpi-cd5ij4pjt65mweeo-vpc.cn-beijing.personal.cr.aliyuncs.com/ai-clinical/ai-clinical_frontend-nginx:v1.3` |
| **backend-service** | v1.7 | ~838MB | `crpi-cd5ij4pjt65mweeo-vpc.cn-beijing.personal.cr.aliyuncs.com/ai-clinical/backend-service:v1.7` |
---
@@ -89,7 +91,7 @@ postgresql://airesearch:Xibahe%40fengzhibo117@pgm-2zex1m2y3r23hdn5.pg.rds.aliyun
| 数据库 | 环境 | Schema数量 | 表数量 | 插件 | 用途 |
|--------|------|-----------|-------|------|------|
| `ai_clinical_research_test` | 测试环境(当前) | 16 | 63 | pg_bigm, pgvector | SAE测试环境 |
| `ai_clinical_research_test` | 测试环境(当前) | 16 | **84** | pg_bigm, pgvector | SAE测试环境 |
| `ai_clinical_research` | 生产环境(备用) | 11 | ~34 | pg_bigm, pgvector | 未来正式上线 |
**Schema架构**16个业务Schema - 测试数据库):
@@ -125,9 +127,10 @@ postgresql://airesearch:Xibahe%40fengzhibo117@pgm-2zex1m2y3r23hdn5.pg.rds.aliyun
| 应用名称 | 状态 | 规格 | 实例数 | 端口 | 内网地址 | 镜像版本 |
|---------|------|------|-------|------|---------|---------|
| **python-extraction-test** | ✅ 运行中 | 1核2GB | 1 | 8000 | `http://172.17.173.84:8000` | v1.1 |
| **nodejs-backend-test** | ✅ 运行中 | 1核2GB | 1 | 3001 | `http://172.17.173.89:3001` | v1.7 |
| **frontend-nginx-service** | ✅ 运行中 | 0.5核1GB | 1 | 80 | `http://172.17.173.90:80` | v1.3 |
| **r-statistics-test** | ✅ 运行中 | 1核2GB | 1 | 8080 | `http://172.17.173.101:8080` | **v1.0.1** |
| **python-extraction-test** | ✅ 运行中 | **2核4GB** | 1 | 8000 | `http://172.17.173.102:8000` | **v1.2** |
| **nodejs-backend-test** | ✅ 运行中 | **2核4GB** | 1 | 3001 | `http://172.17.197.28:3001` | **v2.2** |
| **frontend-nginx-service** | ✅ 运行中 | 0.5核1GB | 1 | 80 | `http://172.17.197.29:80` | **v1.8** |
**环境变量配置**
@@ -350,6 +353,39 @@ AIclinicalresearch/extraction_service/
## 🔄 四、部署历史记录
### 2026-02-270227部署 - 数据库迁移 + R统计引擎 + Python更新
#### 部署概览
- **部署时间**2026-02-27
- **部署范围**数据库Schema迁移、R统计引擎全新部署、Python微服务更新
- **主要变更**6个Prisma迁移含1个drift补丁、新增R Docker服务、Python新增scipy
#### 数据库迁移
- ✅ 应用 5 个业务迁移 + 1 个drift补丁迁移
- ✅ RDS 表数量从 63 增至 84新增 21 张表)
- ✅ 同步 Seed 数据SSA工具库 13条 + IIT技能库 8条
- ✅ 已有数据完整性验证通过Prompt模板、用户数据零丢失
#### R统计引擎全新部署
- ✅ 镜像构建并推送:`ssa-r-statistics:v1.0.1`~1.8GB
- ✅ SAE应用创建`r-statistics-test`1核2GB
- ✅ 内网地址:`http://172.17.173.101:8080`
- ✅ 内置 13 个统计工具描述统计、T检验、卡方检验、回归、Meta分析等
- ✅ 健康检查配置完成HTTP /health
#### Python微服务更新v1.1 → v1.2
- ✅ 新增依赖scipyRVW V2.0 数据取证)
- ✅ 新增代码forensics 数据取证模块
- ✅ 实例规格升级1核2GB → 2核4GB
- ✅ 内网地址变更:`172.17.173.84``172.17.173.102`
#### 文档产出
-`0227部署/01-数据库迁移方案.md`
-`0227部署/02-部署完成总结.md`
-`00-阿里云SAE最新真实状态记录.md`(更新)
---
### 2026-01-270126部署 - 数据库升级 + 全量服务更新)🎉
#### 部署概览
@@ -511,5 +547,5 @@ AIclinicalresearch/extraction_service/
---
> **提示**本文档记录SAE服务器的最新真实状态每次部署后必须更新
> **最后更新**2026-01-01 14:00
> **当前版本**前端v1.2 | 后端v1.3 | Python v1.0 | PostgreSQL 15
> **最后更新**2026-02-27
> **当前版本**前端v1.8 | 后端v2.1 | Python v1.2 | R统计v1.0.1 | PostgreSQL 15