mcpField
C
creating-oracle-to-postgres-master-migration-plan

creating-oracle-to-postgres-master-migration-plan

github.com/github数据与数据库40.5k1.8k 次安装今天更新
代码仓库

关于 creating-oracle-to-postgres-master-migration-plan

分析 .NET 解决方案,判断各项目是否适合从 Oracle 迁移到 PostgreSQL,并生成供后续流程解析的结构化计划。适用于需要梳理项目依赖并安排迁移顺序的团队。

主要功能

  1. 01发现解决方案中的项目
  2. 02检查 Oracle 依赖线索
  3. 03分类迁移资格
  4. 04确认分类与顺序
  5. 05写入结构化计划文件

适用场景

  1. 01盘点解决方案中的 Oracle 项目
  2. 02区分待迁移、跳过与已迁移项目
  3. 03为依赖项目制定迁移顺序

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/github/awesome-copilot --skill creating-oracle-to-postgres-master-migration-plan

安装后在 Claude Code 中输入/creating-oracle-to-postgres-master-migration-plan确认已加载。

详细介绍

创建 Oracle 到 PostgreSQL 主迁移计划

分析一个 .NET 解决方案,对每个项目进行 Oracle→PostgreSQL 迁移资格分类,并编写一份结构化计划,供下游 Agent 和技能解析。

工作流

Progress:
- [ ] Step 1: Discover projects in the solution
- [ ] Step 2: Classify each project
- [ ] Step 3: Confirm with user
- [ ] Step 4: Write the plan file

第 1 步:发现项目

在工作区根目录中找到解决方案文件(扩展名为 .sln 或 .slnx)(如果存在多个,询问用户)。解析它以提取所有 .csproj 项目引用。对于每个项目,记录名称、路径和类型(类库、Web API、控制台、测试等)。

第 2 步:对每个项目分类

扫描每个非测试项目,查找 Oracle 相关指示:

  • NuGet 引用:Oracle.ManagedDataAccess、Oracle.EntityFrameworkCore(检查 .csproj 和 packages.config)
  • 配置条目:appsettings.json、web.config、app.config 中的 Oracle 连接字符串
  • 代码用法:OracleConnection、OracleCommand、OracleDataReader
  • .github/oracle-to-postgres-migration/DDL/Oracle/ 下的 DDL 交叉引用(如果存在)

为每个项目分配一种分类:

分类含义
MIGRATE存在需要转换的 Oracle 交互
SKIP没有 Oracle 相关指示(仅 UI、共享工具等)
ALREADY_MIGRATED存在 -postgres 或 .Postgres 副本,且看起来已处理
TEST_PROJECT测试项目;由测试工作流处理

第 3 步:与用户确认

展示分类后的列表。让用户在最终确定之前调整分类或迁移顺序。

第 4 步:编写计划文件

保存到:.github/oracle-to-postgres-migration/Reports/MasterMigrationPlan.md

使用以下确切模板 —— 下游消费者依赖该结构:

# Master Migration Plan

**Solution:** {solution file name}
**Solution Root:** {REPOSITORY_ROOT}
**Created:** {timestamp}
**Last Updated:** {timestamp}

## DDL Artifacts

**Location:** {path to DDL artifacts, e.g., `.github/oracle-to-postgres-migration/DDL/`}
**External tool used:** {Yes / No} — {If Yes, name the tool (e.g., `ora2pg`) and note that Phase 4 (Schema & DDL Migration) can be skipped; PostgreSQL DDL artifacts already exist.}

## Solution Summary

| Metric | Count |
|--------|-------|
| Total projects in solution | {n} |
| Projects requiring migration | {n} |
| Projects already migrated | {n} |
| Projects skipped (no Oracle usage) | {n} |
| Test projects (handled separately) | {n} |

## Project Inventory

| # | Project Name | Path | Classification | Notes |
|---|---|---|---|---|
| 1 | {name} | {relative path} | MIGRATE | {notes} |
| 2 | {name} | {relative path} | SKIP | No Oracle dependencies |

## Migration Order

1. **{ProjectName}** — {rationale, e.g., "Core data access library; other projects depend on it."}
2. **{ProjectName}** — {rationale}

对项目排序时,应让共享/基础库先于其依赖项迁移。

评论

支持 Markdown