Commit Graph
8 Commits
Author SHA1 Message Date
user 6a248756b5 refactor: consolidate applyMigrations into single exported function
check / check (push) Successful in 1m8s
Remove the unexported applyMigrations() and the runMigrations() method.
ApplyMigrations() is now the single implementation, accepting context
and an optional logger. connect() calls it directly.

All callers updated to pass context.Background() and nil logger.
2026-03-17 01:51:46 -07:00
user 63f8cd1bd0 feat: parse version prefix from migration filenames
check / check (push) Successful in 1m51s
Migration filenames now follow the pattern <version>_<description>.sql
(e.g. 001_initial_schema.sql). The version stored in schema_migrations
is the numeric prefix only, not the full filename stem.

Changes:
- Add ParseMigrationVersion() to extract numeric prefix from filenames
- Validate version is purely numeric, reject malformed filenames
- Rename 001.sql to 001_initial_schema.sql for clarity
- Deduplicate runMigrations/ApplyMigrations via shared applyMigrations()
- Add comprehensive unit tests for version parsing and migration apply

Closes #28
2026-03-15 11:24:31 -07:00
sneak 2cbafe374c Add mock fetcher and service tests for imgcache
Introduces Fetcher interface, mock implementation for testing,
and ApplyMigrations helper for test database setup.
2026-01-08 07:39:18 -08:00
sneak 4595929275 Add embedded SQL migrations system
Migrations are stored in schema/*.sql and embedded via go:embed.
Applied migrations are tracked in schema_migrations table.
Initial schema includes source_content, source_metadata, output_content,
request_cache, negative_cache, and cache_stats tables.
2026-01-08 03:35:43 -08:00
sneak eb2ba92745 Add comment to SQLite blank import 2026-01-08 02:28:05 -08:00
sneak 29adb6ee47 Rename unused parameters to _ to satisfy linter 2026-01-08 02:27:45 -08:00
sneak c68c8909f7 Rename DatabaseParams to Params to avoid stuttering 2026-01-08 02:24:40 -08:00
sneak 516853626d Add basic webserver skeleton with healthcheck 2026-01-08 02:20:23 -08:00