Ticket #509 (assigned enhancement)

Opened 5 years ago

Last modified 3 years ago

Add commented out dependencies automatically

Reported by: david.christian@… Owned by: andrew
Priority: minor Milestone: The Future
Component: commands Version: unknown
Keywords: Cc:


Many data and schema migrations have dependencies on other models - due to foreign keys, for example.

A reasonable default dependency set would be on the latest migration for all foreign keys referenced by the models in the app that is being migrated. This might be overly aggressive, however.

As a compromise between the current situation of _no_ information about possible dependencies and the overly aggressive set of automatic dependencies suggested above, I propose that south add the above set of dependencies commented out, one per line, so that one could go through the list and uncomment or delete them as necessary.

Change History

comment:1 Changed 5 years ago by andrew

  • Priority changed from major to minor
  • Status changed from new to assigned
  • Milestone set to The Future

comment:2 Changed 4 years ago by pegler@…

Just wanted to +1 this ticket. I have recently run into many issues migrating my production environment after creating several migrations in development. Even if the newest migration only depends on the last migration created, this would cause the migrations to be run in the same order when run on a second environment as they were originally run in development, and 99% of the time I would guess this would be the desired behavior.

comment:3 Changed 3 years ago by klaas@…

I'm +1-ing this ticket as well; esp. after #1134 was (I suppose rightfully) closed in favor of this one.

Just pointing out here that the reverse of foreign keys (related_set) should probably also be added to the list of dependencies.

comment:4 Changed 3 years ago by bouke

We ran into major dependency issues (well the lack thereof). I would expect South to store the dependencies as it knows about the migrations I create. Now I needed to reverse-engineer my migrations and derive the dependencies by hand, not a fun job when migrations take around 5 minutes to test.

Note: See TracTickets for help on using tickets.