Hacker News new | ask | show | jobs
by ProblemFactory 4523 days ago
The recommended upgrade path seems to be:

* Apply all South migrations to all database servers,

* Delete South migrations,

* Create new initial (create table) migrations for the current schema.

This makes sense, as migration code is supposed to be temporary. Migrations should exist in the codebase until the last database has them applied. Once all databases are up-to-date, it's better to delete them and "rebase" migrations to the current schema.

Old, fully applied migrations will still stay documented in the version control history, but they shouldn't be part of the master tree, much like obsolete code should be deleted instead of left commented out.

1 comments

This has the added advantage of removing old, crufty migrations. We do this every few months, as there will usually be some problem that will prevent migrations from applying cleanly on new installations (someone made a mistake and reverted imperfectly, something collided and the resolution didn't delete some data, etc).