Schema Diff does not detect foreign keys that reference a different schema
维护者通常 2 天内回复
评估
调研方向
Start with web/pgadmin/browser/server_groups/servers/databases/schemas/tables/schema_diff_table_utils.py and trace the table equality check and table_constraint_comp. Compare how referenced schemas are handled when source and target schema names differ. Done means foreign keys to same named tables in different external schemas are reported as a difference and produce DDL, while references to the compared schemas remain normalized.
由索引模型根据 Issue 内容生成。
描述
Schema Diff reports two tables as identical when their foreign keys reference tables of the same name in different schemas, so the difference is never shown and no DDL is generated for it.
For example, comparing schemas app and app_prod where app.orders has a foreign key to common_a.users and app_prod.orders has the same foreign key to common_b.users: the tables are reported as identical.
The cause is that the table comparison's keys_to_ignore (web/pgadmin/browser/server_groups/servers/databases/schemas/tables/schema_diff_table_utils.py) includes references, refnsp and remote_schema, so the referenced schema is dropped from the initial equality check and table_constraint_comp is never reached. Those keys are ignored so that a reference to the compared schema itself does not count as a difference when the source and target schemas have different names; the fix is to compare the referenced schema after normalising the source and target schema names, rather than ignoring it outright.
This was found by CodeRabbit whilst reviewing #10782, which fixes a related false difference; the gap predates that PR.
- 主要语言
- Python
- 星标
- 3.9k
- 派生
- 922
- 平均合并
- 2 天 3 小时
- 30 天内合并 PR
- 33
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
pgadmin-org/pgadmin4 的其他 Issue
-
Bug
难度 2/5 1-3 小时 新手友好度 62/100
pgadmin-org/pgadmin4#10797 ·
维护者通常 2 天内回复
-
Feature
难度 2/5 1-3 小时 新手友好度 78/100
pgadmin-org/pgadmin4#10426 · 3 条评论 · 1 个 reaction ·
维护者通常 2 天内回复
-
Bug
难度 4/5 3-5 天 新手友好度 25/100
pgadmin-org/pgadmin4#10796 · 1 条评论 ·
维护者通常 2 天内回复
-
Bug
难度 4/5 3-5 天 新手友好度 55/100
pgadmin-org/pgadmin4#10783 ·
维护者通常 2 天内回复
-
pgAdmin 4 v9.19 - Application freezes when interacting with the UI可能已有人在做 @CoderKing2705 今天认领。 未关闭
难度 4/5 3-5 天 新手友好度 35/100
pgadmin-org/pgadmin4#10767 · 1 条评论 · 已指派 1 人 ·
维护者通常 2 天内回复
查看 pgadmin-org/pgadmin4 的全部 Issue
相似的 Issue
-
good first issue
难度 1/5 1 小时以内 新手友好度 72/100
ida-arbeitszeit/workers-control#1588 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 83/100
aws-samples/sample-per-model-bedrock#930 ·
维护者通常 1 天内回复
-
Locus / Transcript lacks __bool__, so bool(transcript) queries the SQLite exon table via __len__未关闭
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 65/100
Deltares/numba_celltree#100 · 1 条评论 ·
-
bug documentation
难度 2/5 1-3 小时 新手友好度 78/100
awslabs/visual-asset-management-system#1646 ·
维护者通常 1 天内回复