A migration squasher that doesn't care how humpty dumpty was put together.
Project description
django-squash is a migration squashing replacement that cares more about keeping migrations small and precise.
Setup
pip install django-squash
Add django_squash to your INSTALLED_APPS.
Profit!
What this does
Let’s say you have an app for a couple of years, with lots of changes to the app’s migrations folder would look something like this:
app/migrations/__init__.py
app/migrations/0001_initial.py
app/migrations/0002_changes.py
...
app/migrations/0400_changes.py
You can run python manage.py squash_migrations and then it will look like this:
app/migrations/__init__.py
app/migrations/0001_initial.py
app/migrations/0002_changes.py
...
app/migrations/0400_changes.py
app/migrations/0401_squashed.py
Inside the 0401_squashed.py, you will find all you migrations including all your RunPython and RunSQL that are elidable.
After you know that all the migrations from 0001 to 0401 have been applied, run python manage.py delete_squashed_migrations.
Run tests
pip install -e '.[test]'
coverage run setup.py test
coverage report -m
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for django_squash-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5b77daf53b767cc5e538a091b95ff4d4c0a431f221eaa6b199f7cceddcaaa773 |
|
MD5 | 6d0c83ba79341242c67625aabe025e82 |
|
BLAKE2b-256 | ce664095e778649c8ff92222cdda74232a16f0af369a4aa98646e97b755483cb |