For example, if you’re adding an index on a 10TB table, you’d just see:
Applying abc123: add index...
…and it will hang there until the database completes the operation.
That said, this is mostly a database-level concern, not something a migration tool can fully abstract away.
If you’re working with large tables, you’d typically want to use:
CREATE INDEX CONCURRENTLY (Postgres)
regardless of which migration tool you’re using.
Migratex generates the SQL, but you can edit it before applying. So in practice, you’d replace:
CREATE INDEX ...
with:
CREATE INDEX CONCURRENTLY ...
in your up.sql.
That said, there are a few things we could improve here:
Show elapsed time per migration
Add a --dry-run flag to preview what would run
Add a --statement-timeout option
These are now on the roadmap.
No comments yet.