Codex Ecto Migration Planning for a PostgreSQL Column Backfill
Split a Phoenix schema change into an additive migration, application compatibility, resumable backfill, and constraint verification.
中文Install in Codex
Use a Phoenix/Ecto project and a local PostgreSQL test database with synthetic data.
- Copy the pinned `skills/elixir-phoenix-migrations/` directory into `.agents/skills/elixir-phoenix-migrations/` in the project.
- Provide the Ecto schema, current migrations, and target field constraints, and review the migration plan first.
Example task
Add `display_label` to a local `products` table with 20 synthetic rows. Backfill from `name` in ID ranges, pause midway, resume from the cursor, and count remaining nulls.What to check
A resumed run touches only pending rows, and a zero null count is the evidence for evaluating the required constraint.
Original SKILL.md on GitHub · Updated
Frequently asked question
How can the backfill avoid rewriting completed rows?
Filter on `display_label IS NULL`, record the processed ID range, and verify the remaining null count.