Feature 02 task 1: SQLite connection and embedded migration runner #10

2 Commits
Author SHA1 Message Date
dev_agentandClaude Opus 5.5 a36cae4517 Make the placeholder migration an immutable 0000_bootstrap
CI / ci (push) Successful in 49s
CI / ci (pull_request) Successful in 48s
Independent review Approved — 0 high findings (#10)
The runner skips versions already recorded by filename, so replacing the
contents of the applied 0001_init.sql placeholder with the real schema
would leave upgraded databases without the new tables. Rename it to
0000_bootstrap.sql, document it as a permanent no-op, and leave
0001_init.sql free for the v1 schema as a brand-new version.

Add a test that migrates with the embedded set, then adds a fixture
0001_init.sql and proves it applies on the existing database.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 00:51:50 -04:00
dev_agentandClaude Opus 5.5 c777668ef5 Add SQLite store and embedded migration runner
CI / ci (pull_request) Successful in 56s
CI / ci (push) Successful in 49s
Independent review Not signed off — 0 high, 1 medium (#10)
internal/store opens $MEALQUEST_DATA_DIR/mealquest.db with modernc.org/sqlite
(CGO-free) as one writer connection and a read-only pool of four, with
busy_timeout=5000, journal_mode=WAL and foreign_keys=ON on every connection.

migrations/*.sql are embedded and applied at boot in filename order, each
in its own transaction together with its schema_migrations row, so a failing
migration rolls back and fails boot. A database holding a version this build
does not know is refused. 0001_init.sql is a placeholder until the v1 schema
lands.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 00:47:33 -04:00