Django migrations without unnecesary change alert triggers.
Project description
Django Simple Migrations
Django migrations without unnecesary change alert triggers.
This project was originally taken from Pretix source code and battle testet across many projects on SoftButterfly.
This package overrides the commands makemigrations
and migrate
, mainly to make that makemigrations
doesn't create migrations on non-significant database model fields and avoid migrate
warnings. As is stated in the source code
-
makemigrations
Django, for theoretically very valid reasons, creates migrations for every single thing we change on a model. Even the
help_text
! This makes sense, as we don't know if any database backend unknown to us might actually use this information for its database schema.However, many projects only supports PostgreSQL, MySQL, MariaDB and SQLite and we can be pretty certain that some changes to models will never require a change to the database. In this case, not creating a migration for certain changes will save us some performance while applying them and allow for a cleaner git history. Win-win!
Only caveat is that we need to do some dirty monkeypatching to achieve it...
-
migrate
Django tries to be helpful by suggesting to run "makemigrations" in red font on every "migrate" run when there are things we have no migrations for. Usually, this is intended, and running "makemigrations" can really screw up the environment of a user, so we want to prevent novice users from doing that by going really dirty and filtering it from the output.
Requirements
- Python 3.8, 3.9, 3.10
Install
pip install django-sb-simple-migrations
Usage
Just add django_sb_simple_migrations
to your INSTALLED_APPS
settings
INSTALLED_APPS = [
# ...
"django_sb_simple_migrations",
# ...
]
Docs
Changelog
All changes to versions of this library are listed in the change history.
Development
Check out our contribution guide.
Contributors
See the list of contributors here.
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-sb-simple-migrations-0.6.0.tar.gz
.
File metadata
- Download URL: django-sb-simple-migrations-0.6.0.tar.gz
- Upload date:
- Size: 7.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.13 CPython/3.7.3 Linux/5.10.101-amd64-desktop
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 50375262f9e585a1d35db9d86f7d2fa8bce5991033bae1de6104714d14a990b5 |
|
MD5 | f4f0acad253440e1b01cf1fd6bb0d33a |
|
BLAKE2b-256 | 4d75991eb9acd53788a6f12ba11a1d6bea863c863584a0f389b86da86995cf56 |
File details
Details for the file django_sb_simple_migrations-0.6.0-py3-none-any.whl
.
File metadata
- Download URL: django_sb_simple_migrations-0.6.0-py3-none-any.whl
- Upload date:
- Size: 9.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.13 CPython/3.7.3 Linux/5.10.101-amd64-desktop
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5ae2ff19645a9561c7fadfcc0654e7f70c3e63573cccd209da66108bec685675 |
|
MD5 | 07bd53a9b770d1ee6736088104e8b2e4 |
|
BLAKE2b-256 | addec7359e5716112a5ceab44916ccc4cd304d5215a98ff6a86ef5434b601b9d |