Skip to main content

Management commands for creating and applying zero migrations.

Project description

django-shell-extended

Provides a zeromigrations management-command that creates and applies zero migrations

Quick start

  1. Install with pip install django-zero-migrations-commands
  2. Add "django-zeromigrations" to your INSTALLED_APPS setting like this:
    INSTALLED_APPS = [
        # ...
        "django-zero-migrations-commands",
    ]
    
  3. (Optional) Change the settings described in the next section in your settings.py
  4. Create zero migrations using python manage.py zeromigrations create
  5. Apply them on other systems using python manage.py zeromigrations apply

Available settings

APPS: Optional[list[str]] = getattr(settings, 'ZERO_MIGRATIONS_APPS', None)
"""The apps to reset migrations for. default: `None`. Will reset migrations for all local apps if `None`."""

ALLOW_CREATE_DEBUG_FALSE: bool = getattr(settings, 'ZERO_MIGRATIONS_ALLOW_CREATE_DEBUG_FALSE', False)
"""Whether the create action can be run in `DEBUG = False` mode. default: `False`"""

CONFIRM_CREATE_DEBUG_FALSE = getattr(settings, 'ZERO_MIGRATIONS_CONFIRM_CREATE_DEBUG_FALSE', False)
"""Whether to ask for confirmation before running the create action in `DEBUG = False` mode. default: `False`"""

ALLOW_APPLY_DEBUG_FALSE: bool = getattr(settings, 'ZERO_MIGRATIONS_ALLOW_APPLY_DEBUG_FALSE', True)
"""Whether the apply action can be run in `DEBUG = False` mode. default: `True`"""

CONFIRM_APPLY_DEBUG_FALSE = getattr(settings, 'ZERO_MIGRATIONS_CONFIRM_APPLY_DEBUG_FALSE', True)
"""Whether to ask for confirmation before running the apply action in `DEBUG = False` mode. default: `True`"""

What it does

  • create removes the migrations of your apps and replaces them by a new initial migration. Resets your migration history to this migration.
  • apply is used to reset the migration history on other instances after receiving the new migrations by other means (i.e. version control)

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_zero_migrations_commands-1.0.0.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file django_zero_migrations_commands-1.0.0.tar.gz.

File metadata

File hashes

Hashes for django_zero_migrations_commands-1.0.0.tar.gz
Algorithm Hash digest
SHA256 d19652b8895cef7dfba9cd04ffd069bcf8e79aac8c2257b72c44c6e21aa8e1c6
MD5 a699e03aee77ca143da47cd7465a6df9
BLAKE2b-256 e7f9a10555a108dc4d7a4022dba160c67f979c84df639170c01529400b9c07d2

See more details on using hashes here.

File details

Details for the file django_zero_migrations_commands-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for django_zero_migrations_commands-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9cfe34ab25ba9dd793a2b2b4bf0887cbeb8d11e2d9174ac824eb9cbc7e062917
MD5 e0607e775655f3a66bd726725d276ffb
BLAKE2b-256 4db5c380dcba152bed78db4f5cf611718e6794665af4706ae61523add79a8491

See more details on using hashes here.

Supported by

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