A Django admin command to recreate all migrations in a project.
Project description
Django remake migrations
Documentation: https://django-remake-migrations.readthedocs.io
Source Code: https://github.com/browniebroke/django-remake-migrations
A Django admin command to recreate all migrations in a project. Like a squashmigrations
command on steroids.
The problem
The built-in squashmigrations
command is great, but it has some limitations:
- It only works on a single app at a time, which means that you need to run it for each app in your project. On a project with enough cross-apps dependencies, it quickly becomes impossible to run.
- It doesn't optimise the operations, it only reduces the number of migration files. That being said, Django 4.1 introduced a new
optimizemigrations
command which sounds like it might be doing just this.
This command aims at solving this problem, by recreating all the migration files in the whole project, from scratch, and mark them as applied by using the replaces
attribute.
It makes an important trade-off though: it does NOT try to be correct when setting the replaces
attribute. The only guarantees are that:
- all old migrations are marked as replaced once.
- all new migrations replace at least one of the old migrations
This is OK to make this trade-off as long as all your environments are fully migrated when you deploy the remade migrations.
Contributors ✨
Thanks goes to these wonderful people (emoji key):
Bruno Alla 💻 🤔 📖 |
Dmytro Litvinov 📖 |
This project follows the all-contributors specification. Contributions of any kind welcome!
Credits
This package was created with Copier and the browniebroke/pypackage-template project template.
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
File details
Details for the file django_remake_migrations-2.2.0.tar.gz
.
File metadata
- Download URL: django_remake_migrations-2.2.0.tar.gz
- Upload date:
- Size: 9.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | da5d7c9657ea094553290d5f3178ee2e0f63a079d00344eb75ecc5584c3705a7 |
|
MD5 | 99ffa0045036f5cec18ce10c51ab826f |
|
BLAKE2b-256 | ecc65d0a7863d6ca63a9af44ca03dadffbf00b94a9970f43c81630b64cb54874 |
Provenance
The following attestation bundles were made for django_remake_migrations-2.2.0.tar.gz
:
Publisher:
ci.yml
on browniebroke/django-remake-migrations
-
Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
django_remake_migrations-2.2.0.tar.gz
- Subject digest:
da5d7c9657ea094553290d5f3178ee2e0f63a079d00344eb75ecc5584c3705a7
- Sigstore transparency entry: 145670444
- Sigstore integration time:
- Predicate type:
File details
Details for the file django_remake_migrations-2.2.0-py3-none-any.whl
.
File metadata
- Download URL: django_remake_migrations-2.2.0-py3-none-any.whl
- Upload date:
- Size: 8.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 930e3ab683dcabbdcf5244c0725276e34c1c1bee22e4100c432957c58cde9f26 |
|
MD5 | b766b73eada42f59c15c02293a7dd9a2 |
|
BLAKE2b-256 | e862676cd7ae1890ba8919aed63e19e684f3e71d50d9dbd48d66d1d3150ffe6e |
Provenance
The following attestation bundles were made for django_remake_migrations-2.2.0-py3-none-any.whl
:
Publisher:
ci.yml
on browniebroke/django-remake-migrations
-
Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
django_remake_migrations-2.2.0-py3-none-any.whl
- Subject digest:
930e3ab683dcabbdcf5244c0725276e34c1c1bee22e4100c432957c58cde9f26
- Sigstore transparency entry: 145670446
- Sigstore integration time:
- Predicate type: