fix(db): tolerate SQLite optional COLUMN keyword in migration parsing (#8368)#8456
Conversation
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8456 +/- ##
==========================================
- Coverage 92.43% 89.64% -2.79%
==========================================
Files 791 98 -693
Lines 79317 22838 -56479
Branches 23954 3908 -20046
==========================================
- Hits 73314 20473 -52841
+ Misses 4866 2187 -2679
+ Partials 1137 178 -959
Flags with carried forward coverage won't be shown. Click here to find out more.
|
|
Tip ✅ LoopOver review result - approve/merge recommendedReview updated: 2026-07-24 14:11:34 UTC
Review summary Nits — 4 non-blocking
Decision drivers
Context & advisory signals — never blocks the verdict
Linked issue satisfactionAddressed Review context
Contributor next steps
Signal definitions
🧪 Chat with LoopOverAsk LoopOver a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.
Full command reference: https://loopover.ai/docs/loopover-commands 🧪 Experimental — new and may change. 🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by LoopOver, a quiet PR intelligence layer for OSS maintainers.
|
Summary
src/db/migration-column-extraction.ts'sextractSchemaEventspowers the CI-gating column-collision check (scripts/check-migrations.ts/db:migrations:check). Its threeALTER TABLE ... COLUMN ...regexes (RENAME/DROP/ADD) all required the literalCOLUMNkeyword, but SQLite's actual grammar makes it optional for all three forms (ALTER TABLE t ADD x INTEGER,DROP x,RENAME x TO yare all valid, verified directly against realsqlite3). A migration using the terser syntax produced zeroSchemaEvents and was silently invisible to collision detection. MadeCOLUMNoptional (\s+(?:COLUMN\s+)?) in all three regexes.Scope
type(scope): short summaryConventional Commit format, for examplefix(api): restore profile access checks.CONTRIBUTING.mdand does not reintroduce GitHub Pages, VitePress,site/, orCNAME.Closes #123) — a linked open issue is required for every contributor PR.Closes #8368
Validation
git diff --checknpm run typechecknpx vitest run test/unit/migration-column-extraction.test.ts --coverage --coverage.include="src/db/migration-column-extraction.ts"— all 36 tests pass (33 pre-existing + 3 new), 100% statements/branches/functions/lines on the changed filenpx tsx scripts/check-migrations.ts— ran directly against the real 178-file migration corpus:178 migrations OK — contiguous 0001..0174 ..., no new duplicates, confirming the widened regexes don't misparse any existing migrationnpm run actionlintnpm run test:workersnpm run build:mcpnpm run test:mcp-packnpm run ui:openapi:checknpm run ui:lintnpm run ui:typechecknpm run ui:buildnpm audit --audit-level=moderateIf any required check was skipped, explain why:
src/db/migration-column-extraction.tsand its unit test (no UI/MCP/worker/OpenAPI surface touched), so the UI/MCP/workers/OpenAPI-specific checks above were not run locally; they are unaffected by this diff and are still exercised by the full CI gate.Safety
UI Evidencesection below. (N/A — no visible UI change.)UI Evidence
N/A — this is a backend/tooling parser change with no visible UI surface.
Notes
COLUMNhandling changed; no other parsing or collision-detection logic touched, per the issue's own scope note. No multi-columnALTER TABLEvariant support was added (explicitly out of scope).