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
This commit is contained in:
clawbot
2026-03-26 06:55:05 -07:00
parent 31a6299ce7
commit 22cc1a7fb1
3 changed files with 35 additions and 17 deletions

View File

@@ -0,0 +1,9 @@
-- Migration 000: Schema migrations tracking table
-- Applied as a bootstrap step before the normal migration loop.
CREATE TABLE IF NOT EXISTS schema_migrations (
version INTEGER PRIMARY KEY,
applied_at DATETIME DEFAULT CURRENT_TIMESTAMP
);
INSERT OR IGNORE INTO schema_migrations (version) VALUES (0);