Do not generate unnecessary migrations
Project description
django-migrations-ignore-attrs
django-migrations-ignore-attrs is a package that overrides makemigration and migrate commands for Django’s manage.py command.
django-migrations-ignore-attrs allows to avoid making of unnecessary migrations for attributes that do not have any representation in database schema.
Following attributes of model are ignored:
verbose_name
verbose_name_plural
Following attributes of standard fields are ignored:
choices
help_text
verbose_name
Following attributes of ForeignKey are ignored:
related_name
related_query_name
Installation
Install with pip or pipenv:
pip install django-migrations-ignore-attrs
Add django_migrations_ignore_attrs to your installed apps in your settings.py file:
INSTALLED_APPS = [
'django_migrations_ignore_attrs',
...
]
Optional configuration:
# ignored attributes of model
MIGRATION_IGNORE_MODEL_ATTRS = ['verbose_name', 'verbose_name_plural']
# ignored attributes of standard fields
MIGRATION_IGNORE_FIELD_ATTRS = ['choices', 'help_text', 'verbose_name']
# ignored attributes of ForeignKey
MIGRATION_IGNORE_RELATED_FIELD_ATTRS = ['related_name', 'related_query_name']
Commands
makemigrations
Creates new migration(s) for apps.
All options are the same as for original makemigrations command from django app.
migrate
Updates database schema. Manages both apps with migrations and those without.
All options are the same as for original migrate command from django app.
Documentation
License
Copyright © 2019, Piotr Roszatycki
This software is distributed under the GNU Lesser General Public License (LGPL 3 or greater).
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-migrations-ignore-attrs-0.1.0.tar.gz
.
File metadata
- Download URL: django-migrations-ignore-attrs-0.1.0.tar.gz
- Upload date:
- Size: 16.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.7.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e3cf0a54d51fae7564e792f27f41173e6474e18be1628270fa0b6ba43ed5acaf |
|
MD5 | 6a5d643e0b1913d593264b13c6f94997 |
|
BLAKE2b-256 | 34dafb733d6d021e44822339acb076d4ddce1503180a926d26009f1c61c26967 |
File details
Details for the file django_migrations_ignore_attrs-0.1.0-py2.py3-none-any.whl
.
File metadata
- Download URL: django_migrations_ignore_attrs-0.1.0-py2.py3-none-any.whl
- Upload date:
- Size: 7.1 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.7.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1410276711dd17797889d06dd7a271ddb941af3439e2693cee44009c7ad174a8 |
|
MD5 | d2547fdf88c4a61dbfb8eb56931b25d0 |
|
BLAKE2b-256 | f7f2bf0a4fe4f67584630ceeba6fc4db8865ce32c1d7fc8914aa6ffb03a3b4cf |