Existing databases with schema_migrations table work (CREATE TABLE IF NOT EXISTS + INSERT OR IGNORE are idempotent)
Generated with Claude Code
## Summary
- Moves schema_migrations table creation from inline Go code into internal/db/schema/000_bootstrap.sql
- Bootstrap SQL is executed directly before the migration loop (which starts from 001+)
- Go code does zero INSERTs for the bootstrap — 000_bootstrap.sql handles the INSERT OR IGNORE for version 0
- loadMigrations() skips 000.sql so it is not processed by the normal migration loop
Follows the sneak/pixa pattern.
closes #91
## Test plan
- [x] All existing tests pass (make test in Docker)
- [x] Linter passes (make lint)
- [x] Docker build succeeds (docker build --no-cache .)
- [x] Existing databases with schema_migrations table work (CREATE TABLE IF NOT EXISTS + INSERT OR IGNORE are idempotent)
Generated with Claude Code
Move the inline CREATE TABLE IF NOT EXISTS schema_migrations from Go
code into a dedicated 000_bootstrap.sql file, following the sneak/pixa
pattern. The bootstrap SQL is executed directly before the migration
loop, which now starts from 001+. The bootstrap file also handles its
own INSERT OR IGNORE so the Go code does zero inserts for version 0.
closes#91
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Re-Review: PR #95 — Move schema_migrations into 000.sql (post-rework)
Result: PASS✅
Requirements Checklist
#
Requirement
Status
1
schema_migrations DDL in 000.sql
✅ File correctly named 000.sql
2
version column is INTEGER PRIMARY KEY
✅
3
000.sql is self-contained (CREATE TABLE IF NOT EXISTS + INSERT OR IGNORE)
✅
4
Go code does zero INSERTs for bootstrap
✅ (only per-migration INSERT remains, as expected)
Verification
000.sql contains both CREATE TABLE and INSERT OR IGNORE for version 0
db.go reads and executes 000.sql before the migration loop
loadMigrations() skips version 0 (if version == 0 { continue })
No inline CREATE TABLE for schema_migrations in Go code
docker build --no-cache . passes — all tests green
Ready to merge.
## Re-Review: PR #95 — Move schema_migrations into 000.sql (post-rework)
**Result: PASS** ✅
### Requirements Checklist
| # | Requirement | Status |
|---|---|---|
| 1 | schema_migrations DDL in `000.sql` | ✅ File correctly named `000.sql` |
| 2 | version column is `INTEGER PRIMARY KEY` | ✅ |
| 3 | 000.sql is self-contained (`CREATE TABLE IF NOT EXISTS` + `INSERT OR IGNORE`) | ✅ |
| 4 | Go code does zero INSERTs for bootstrap | ✅ (only per-migration INSERT remains, as expected) |
### Verification
- `000.sql` contains both CREATE TABLE and INSERT OR IGNORE for version 0
- `db.go` reads and executes `000.sql` before the migration loop
- `loadMigrations()` skips version 0 (`if version == 0 { continue }`)
- No inline CREATE TABLE for schema_migrations in Go code
- `docker build --no-cache .` passes — all tests green
Ready to merge.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
Follows the sneak/pixa pattern.
closes #91
Test plan
Generated with Claude Code
Review: PR #95 — Move schema_migrations into 000.sql
Result: FAIL — 1 blocking issue
Requirements Checklist
000_bootstrap.sqlinstead of000.sqlBlocking Issue
File naming: Issue #91 specifies
000.sql. The PR uses000_bootstrap.sql. Rename to000.sqland update the reference indb.go.Build
docker build --no-cache .passes — lint clean, all tests green.Verdict
FAIL — rename file to
000.sql.106a8e1a84tof6d33e3cebFixed: renamed
000_bootstrap.sql→000.sqland updated the reference indb.go.docker build --no-cache .passes.Re-Review: PR #95 — Move schema_migrations into 000.sql (post-rework)
Result: PASS ✅
Requirements Checklist
000.sql000.sqlINTEGER PRIMARY KEYCREATE TABLE IF NOT EXISTS+INSERT OR IGNORE)Verification
000.sqlcontains both CREATE TABLE and INSERT OR IGNORE for version 0db.goreads and executes000.sqlbefore the migration looploadMigrations()skips version 0 (if version == 0 { continue })docker build --no-cache .passes — all tests greenReady to merge.