Skip to content

feat(schema-diff): 支持按字段和索引选择同步对象 - #6963

Open
DASungta wants to merge 17 commits into
t8y2:mainfrom
DASungta:feat/structure-diff-tree-select
Open

feat(schema-diff): 支持按字段和索引选择同步对象#6963
DASungta wants to merge 17 commits into
t8y2:mainfrom
DASungta:feat/structure-diff-tree-select

Conversation

@DASungta

Copy link
Copy Markdown
Contributor

目的

优化 #6482 的架构比较结果页,使用户可以查看并选择具体表、字段和索引,避免只能整库同步。数据库仍由外层配置选择,结果树不重复增加数据库节点。

改动

  • 结果页调整为“操作分组 -> 表/对象 -> 字段、索引、外键、触发器、表选项”的树形结构,支持全选、半选和局部选择。
  • 选择范围通过结构化 diff 重新生成前向/回滚 SQL,并同步更新删除风险、统计和兼容性告警;字段顺序、索引和外键依赖会自动联动。
  • 点击字段或索引可在源/目标 DDL 中定位;完善连续差异高亮、树缩进、空白行显示及旧比较状态清理。
  • 桌面端与 Web 端共用 Schema Sync plan 接口,并补充相关单元测试。

验证

  • pnpm typecheck
  • Schema Diff 定向测试:13 个测试文件、76 个测试通过
  • pnpm build
  • Rust Schema Sync plan 用例通过
  • cargo check -p dbx-web
  • cargo check -p dbx

截图

字段选择与 DDL 定位

字段选择与 DDL 定位

新建、删除对象及索引/外键展示

新建、删除对象及索引外键展示

Closes #6482

@github-actions github-actions Bot added area/core Shared DBX core runtime area/desktop Desktop application or Tauri shell area/web Web backend or web API enhancement New feature or request ui-change Changes user-visible interface, text, or visual assets labels Aug 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/core Shared DBX core runtime area/desktop Desktop application or Tauri shell area/web Web backend or web API enhancement New feature or request ui-change Changes user-visible interface, text, or visual assets

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] 数据库结构对比功能现在的非常不方便

1 participant