Graf commitů

2 Commity

Autor SHA1 Zpráva Datum
clawbot
8b6aa74951 Remove backwards compat code: no installed base pre-1.0
Všechny kontroly byly úspěšné
check / check (push) Successful in 1m49s
- Simplify bootstrapMigrationsTable to just check table existence and
  apply 000.sql if missing — no legacy DB detection
- Remove ensureBootstrapVersionRecorded (legacy backfill path)
- Remove applyBootstrapMigration (separate helper, now inlined)
- Remove TestBootstrapMigrationsTable_ExistingTableBackwardsCompat
- Simplify 000.sql header comment
2026-03-17 19:47:59 -07:00
user
3d92f2625b Move schema_migrations table creation from Go code into 000.sql
Všechny kontroly byly úspěšné
check / check (push) Successful in 1m43s
The schema_migrations table definition now lives in
internal/database/schema/000.sql instead of being hardcoded as an
inline SQL string in database.go. A bootstrap step checks
sqlite_master for the table and applies 000.sql when it is missing.
Existing databases that already have the table (created by older
inline code) get version 000 back-filled so the normal migration
loop skips the file.

Also deduplicates the migration logic: both the Database.runMigrations
method and the exported ApplyMigrations helper now delegate to a single
applyMigrations function.

Adds database_test.go with tests for fresh migration, idempotency,
bootstrap on a fresh DB, and backwards compatibility with legacy DBs.
2026-03-17 19:23:40 -07:00