Pavel Patrin
Pavel Patrin

Reputation: 1736

Move package with migrations in django

How to move package from one place to another in Django (1.4) with south? Package has applied migrations.

Upvotes: 0

Views: 100

Answers (2)

Max Tepkeev
Max Tepkeev

Reputation: 2786

As far as I know there is no automatic way to do that, so you'll have to do the following by hand:

  1. Move your package to the new place
  2. Reflect this change in your settings.py INSTALLED_APPS
  3. In all the migration files of you package you have to edit the module path, table names and complete_apps list
  4. In your database table south_migrationhistory you have to edit the app_name column
  5. Rename the app table(s) in the database

That's all. To check that everything is working properly you can type python manage.py schemamigration your_new_app_name --auto and if you did everything properly it will say that nothing have changed. Now you can continue working with your app as usual.

Upvotes: 1

Pavel Patrin
Pavel Patrin

Reputation: 1736

Another solution is just move package to another namespace/place but don`t change package name.

Upvotes: 0

Related Questions