Skip to main content

Django migrations without unnecesary change alert triggers.

Project description

Community project

PyPI - Supported versions PyPI - Package version PyPI - Downloads PyPI - MIT License

Build Status Codacy Badge Codacy Badge codecov Requirements Status

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.6, 3.7, 3.8, 3.9

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


Download files

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

Source Distribution

django-sb-simple-migrations-0.4.0.tar.gz (7.3 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file django-sb-simple-migrations-0.4.0.tar.gz.

File metadata

  • Download URL: django-sb-simple-migrations-0.4.0.tar.gz
  • Upload date:
  • Size: 7.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.6 CPython/3.9.5 Linux/5.10.36-amd64-desktop

File hashes

Hashes for django-sb-simple-migrations-0.4.0.tar.gz
Algorithm Hash digest
SHA256 9defb4a24e1b3c5d2a07bb38ba5ce33711299c6f8647ca91f53d63c8d2c24438
MD5 fa10b76d860e7271a0d5d0be8f327afa
BLAKE2b-256 67fb9c5cbb174624a98d8042a8f54e4ec47f824bd2bcd89610fd4ef6f07ba693

See more details on using hashes here.

File details

Details for the file django_sb_simple_migrations-0.4.0-py3-none-any.whl.

File metadata

File hashes

Hashes for django_sb_simple_migrations-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 66ba8365cf1874dd15e2df951bd6881104a2ab1a2477eb477b57ee2f6f2c35ff
MD5 ff39ab6bfdba2191f7fc719a0045d0c1
BLAKE2b-256 c1785f503bf8032d9b6c0599dc6f4e257e797579e181a3ba5d021ff1fcbce56e

See more details on using hashes here.

Supported by

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