Commit Graph

3 Commits

Author SHA1 Message Date
user
6591f77dac remove legacy migration conversion code
Pre-1.0 software with no installed base — no need to handle
converting from old TEXT-based schema_migrations format.

Removed: convertLegacyMigrations, ensureBootstrapVersion,
readLegacyVersions, rebuildMigrationsTable, and
TestApplyMigrationsLegacyConversion.

Simplified bootstrapMigrationsTable to only check existence
and run 000_migration.sql if missing.
2026-03-26 08:37:44 -07:00
clawbot
22cc1a7fb1 fix: rename 000.sql to 000_migration.sql and wrap legacy conversion in transaction
- Rename bootstrap migration from 000.sql to 000_migration.sql per
  REPO_POLICIES.md naming convention (NNN_description.sql pattern)
- Update all hardcoded references in migrations.go
- Wrap rebuildMigrationsTable() DROP/CREATE/INSERT sequence in a
  single transaction for crash safety
- Update test case filename to match renamed file
2026-03-26 06:55:05 -07:00
user
31a6299ce7 Move schema_migrations table creation into 000.sql with INTEGER version column
Refactors the migration system to follow the pixa pattern:

- Add 000.sql bootstrap migration that creates schema_migrations with
  INTEGER PRIMARY KEY version column
- Go code no longer creates the migrations table inline; it reads and
  executes 000.sql as a bootstrap step before the normal migration loop
- Export ParseMigrationVersion and ApplyMigrations for test use
- Add legacy TEXT-to-INTEGER conversion for existing databases that
  stored migration versions as filenames (e.g. '001_initial.sql')
- Wrap individual migration application in transactions for safety
- Add comprehensive tests for version parsing, fresh database bootstrap,
  idempotent re-application, and legacy conversion
2026-03-26 06:43:53 -07:00