afe789c415
Documents Phase 11 Plan 1 outcome: tags table schema + migration scripts complete and committed; DB-execution steps (push migration, run legacy consolidation, run tag-assignment + validators) blocked by network/SSH access gate to 178.104.27.55:54321 (firewalled, SSH-only per project memory). Logs pre-existing drizzle-kit migration tooling drift and the stale quote_items<->service_catalog JOIN as deferred non-blocking items.
23 lines
2.8 KiB
Markdown
23 lines
2.8 KiB
Markdown
# Deferred Items — Phase 11
|
|
|
|
Items discovered during execution that are out of scope for the current plan/task but logged for future cleanup.
|
|
|
|
## From Plan 11-01
|
|
|
|
### 1. `drizzle-kit generate` non-functional (migration tooling drift)
|
|
|
|
- **Found during:** 11-01, Task 1, step 5
|
|
- **Issue:** `src/db/migrations/meta/_journal.json` and snapshot files are out of sync with `schema.ts`. Only `meta/0000_snapshot.json` exists; the journal has entries through `0001` only; SQL files `0003`, `0004`, `0005` (and now `0006`, added in 11-01) were hand-written without corresponding journal entries or snapshots. Running `npx drizzle-kit generate` fails immediately with `Error: Interactive prompts require a TTY terminal` because drizzle-kit computes a huge diff against the stale `0000` snapshot.
|
|
- **Origin:** Pre-existing since Phase 8 (commit `f727954`, "feat(08-02): create Phase 8 migration and validation script" — hand-wrote `0003_offer_phases_quote_templates.sql` without updating journal/snapshots).
|
|
- **Impact:** Every future migration in this repo must be hand-written following Drizzle's SQL output conventions (as 11-01 did for `0006_add_tags_table.sql`) until snapshots are reconciled. Low risk as long as the convention is followed consistently, but increases manual effort and risk of SQL syntax drift from what Drizzle would generate.
|
|
- **Recommended fix:** Architectural-scope task (Rule 4 — requires user decision): either (a) regenerate `meta/*_snapshot.json` files for `0001`-`0006` by introspecting the current live schema with `drizzle-kit pull` or manual reconstruction, or (b) accept hand-written migrations as the permanent convention and document it explicitly in `CLAUDE.md`/project docs so future agents don't attempt `drizzle-kit generate` and waste a turn on the TTY error.
|
|
- **Status:** Not fixed. Logged only.
|
|
|
|
### 2. Stale `quote_items` ↔ `service_catalog` JOIN in `admin-queries.ts`
|
|
|
|
- **Found during:** 11-01 Task 2 (carried over from `11-CONTEXT.md` "Claude's Discretion")
|
|
- **Issue:** `src/lib/admin-queries.ts` (lines ~335/343 and ~531/539) does `leftJoin(service_catalog, eq(quote_items.service_id, service_catalog.id))`, but `quote_items.service_id` is typed as `references(() => services.id, ...)` (post-Phase-8). For `quote_items` rows created after Phase 8, this JOIN won't match and the label falls back to `COALESCE(..., quote_items.custom_label)`, which may be `null`.
|
|
- **Impact:** Low — admin-only label display in client/project workspace quote_items list. Non-blocking per `11-CONTEXT.md`.
|
|
- **Recommended fix:** 4-line change — replace `leftJoin(service_catalog, ...)` with `leftJoin(services, eq(quote_items.service_id, services.id))` and `service_catalog.name` with `services.name` in both `COALESCE` expressions, at both line ranges.
|
|
- **Status:** Not fixed. Candidate for Phase 12 cleanup or standalone hotfix.
|