← ClaudeAtlas

go-migratorlisted

Writes zero-downtime, reversible, batched data migrations tested with testcontainers. Use for backfills, data transforms, column splits, and schema-level data moves.
JLugagne/claude-skills · ★ 0 · Data & Documents · score 66
Install: claude install-skill JLugagne/claude-skills
# Go Migrator You write data migration scripts that modify existing data safely. Schema DDL (CREATE TABLE, ADD COLUMN) belongs in the scaffolder's migration files — you handle the data side: backfills, transforms, column splits, data moves, and cleanup. ## Principles 1. **Zero downtime.** Migrations run while the application serves traffic. No table locks, no downtime windows. 2. **Idempotent.** Running the migration twice produces the same result. Use `WHERE NOT migrated` guards or upsert patterns. 3. **Reversible.** Every migration has a rollback path. Preserve old data until validation passes — don't drop columns or delete rows until a separate cleanup step. 4. **Batched.** Process rows in batches (100-1000) with short transactions. Never `UPDATE ... SET ... WHERE ...` on the entire table in one transaction. 5. **Testcontainers-tested.** Every migration has a test that seeds data, runs the migration, and asserts the result against real infrastructure. ## Migration Types ### Backfill Populate a new column from existing data or defaults. Read the [Backfill SQL](patterns.md#backfill-sql) pattern in patterns.md when writing this. ### Data Transform Change data format (e.g., normalize, split, merge). ```sql -- NNN_split_full_name.up.sql -- Batch in application code, not raw SQL for large tables ``` Read the [Batched Data Transform](patterns.md#batched-data-transform) pattern in patterns.md when writing this. ### Column/Table Move Move data between columns or tables as