`bos db doctor` checks expected tables only in `public` — misreports plugin_schema (v2) and v1 topologies
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 1-2 天
- 新手友好度
- 52/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- typescript
- 领域
- database
调研方向
Read services/db/doctor.ts and compare its missing-tables query with the schemaName handling in runMigrations and detectDrift. Trace how workspace topology determines the data schema for plugins versus api/auth or dedicated databases. Done means the doctor checks expected tables in the schema used by each topology and reports healthy and drift states consistently.
由索引模型根据 Issue 内容生成。
描述
Environment
everything-dev 2.0.0-rc.27
Where
services/db/doctor.ts — the missing-tables query hard-codes the schema:
```ts
// dist/services/db/doctor.mjs:60
SELECT table_name FROM information_schema.tables
WHERE table_schema = 'public'
AND table_name = ANY($1)
```
Context
v2 scopes plugin data tables into a `plugin_` schema on the shared database: the driver sets `search_path="plugin_,public"` per pooled connection, and `runMigrations` / `detectDrift` take a `schemaName` parameter they use for the same table-existence query. The migration journal is the shared `drizzle.__drizzle_migrations`. The doctor never learned about the namespace.
Failure modes (both observed on nearbuilders.org during a v1→v2 consolidation)
- v1 per-plugin database (tables in `public`, journal present): doctor reports `healthy` while boot fails with `drift-safe-repair` — because the runtime checks `plugin_`, not `public`.
- Consolidated shared database (tables in `plugin_`): doctor reports `drift-safe-repair` for completely healthy databases. Combined with `bos db repair` (see my related issue on repair) this invites destroying a working state.
Suggested fix
Resolve the workspace's data schema per topology — `plugin_` for plugins, `public` for api/auth/dedicated-DB — and query the expected tables there, mirroring `detectDrift`'s `schemaName` handling.
- 主要语言
- TypeScript
- 星标
- 5
- 派生
- 3
- 平均合并
- 9 小时 37 分钟
- 30 天内合并 PR
- 157
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
NEARBuilders/everything-dev 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 77/100
NEARBuilders/everything-dev#628 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
NEARBuilders/everything-dev#400 ·
维护者通常 1 天内回复
-
难度 5/5 一周以上 新手友好度 35/100
NEARBuilders/everything-dev#664 ·
维护者通常 1 天内回复
-
难度 5/5 一周以上 新手友好度 35/100
NEARBuilders/everything-dev#661 ·
维护者通常 1 天内回复
-
难度 5/5 一周以上 新手友好度 35/100
NEARBuilders/everything-dev#660 ·
维护者通常 1 天内回复
查看 NEARBuilders/everything-dev 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 66/100
CopilotKit/openmuse#215 ·
维护者通常 3 天内回复
-
b:minor bug
难度 2/5 1-3 小时 新手友好度 76/100
software-mansion/argent#1698 ·
维护者通常 1 天内回复
-
e2e-failure ready-to-code
难度 2/5 1-3 小时 新手友好度 72/100
redhat-developer/rhdh-plugin-export-overlays#4624 · 1 条评论 ·
维护者通常 1 天内回复