Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

`bos db doctor` checks expected tables only in `public` — misreports plugin_schema (v2) and v1 topologies

Đang mở
#663 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
52/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
typescript
Lĩnh vực
database

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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)

  1. 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`.
  2. 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.

Ngôn ngữ chính
TypeScript
Star
5
Fork
3
Merge trung bình
9 giờ 37 phút
Pull request đã merge (30 ngày)
157

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của NEARBuilders/everything-dev

Tất cả issue của NEARBuilders/everything-dev

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.