Skip to main content

Django helper for more complicated migrations.

Project description

=======================
Django Migration Helper
=======================

Django Migration Helper is a simple app containing commands that
make more complicated migrations a lot easier. Use it if you want to
perform some structural changes in your code while keeping the data in your database intact.

Quick start
-----------

1. Add "migration_helper" to your INSTALLED_APPS setting like this::

INSTALLED_APPS = [
...
'migration_helper',
]

Basic Usage
-----------
Before using make sure you have applied all your previous migrations! Make sure your
database state is neutral. Also, as an extra precaution, you may want to dump your
database, just in case.
Next, physically move the model between apps and resolve all import dependecies.
As a next step you run this command:

::
python manage.py move_model <model_label> <base_app> <target_app> [**options]

This command creates migration files for an operation of moving a model
(given by `<model_label>`) from `<base_app>` to `<target_app>` keeping the data
already stored in database intact and resolving all relative fields using
`migrations.SeperateStateAndDatabase` operations.


By default this command only generates migration files.
Next step would be to run `python manage.py migrate`.
If you want to do it automatically, running this command
with `--migrate` flag applies the migrations.
Running this with `--dry-run` doesn't create migration files,
it just shows what operations would be made in the console.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-migration-helper-0.1.1.tar.gz (5.7 kB view details)

Uploaded Source

File details

Details for the file django-migration-helper-0.1.1.tar.gz.

File metadata

File hashes

Hashes for django-migration-helper-0.1.1.tar.gz
Algorithm Hash digest
SHA256 bfb7fbcbde712d37de251d878bb1717601d9fcfd51cf44019b961cd2d8612aa6
MD5 2623825fdbce0c2d5ddb9b8d60450e4c
BLAKE2b-256 b0c9f244fd9e297480c544880d62e0f1afa152407f546b4df9634e6d7fbaccd3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page