Skip to main content

Management commands for creating and applying zero migrations.

Project description

django-zero-migrations-commands

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_zero_migrations_commands" 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

ZERO_MIGRATIONS_APPS: Optional[list[str]] = None
"""The apps to reset migrations for. default: `None`.
Will reset migrations for all local apps if `None`."""

ZERO_MIGRATIONS_ALLOW_CREATE_DEBUG_FALSE: bool = False
"""Whether the create action can be run in `DEBUG = False` mode. default: `False`"""

ZERO_MIGRATIONS_CONFIRM_CREATE_DEBUG_FALSE: bool = False
"""Whether to ask for confirmation before running the create action in `DEBUG = False` mode.
default: `False`"""

ZERO_MIGRATIONS_ALLOW_APPLY_DEBUG_FALSE: bool = True
"""Whether the apply action can be run in `DEBUG = False` mode. default: `True`"""

ZERO_MIGRATIONS_CONFIRM_APPLY_DEBUG_FALSE: bool = True
"""Whether to ask for confirmation before running the apply action in `DEBUG = False` mode.
default: `True`"""

ZERO_MIGRATIONS_BEFORE_CREATE_HOOK: Optional[Callable[[], None]] = None
"""The hook to run before creating new migrations. default: `None`."""

What it does

  • create removes the migrations of your apps and replaces them by a new initial migration.
  • apply resets the migration history after creating or 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.3.tar.gz (4.1 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.3.tar.gz.

File metadata

File hashes

Hashes for django_zero_migrations_commands-1.0.3.tar.gz
Algorithm Hash digest
SHA256 43577fd8d86c81f4522fc8b8390857e6ebcd20eb84044d923e9a647195043f03
MD5 17b0173eb0ffafb917690fc06d5dd8d3
BLAKE2b-256 b7550f323063d67d433539d6264a090e7d56354465e4085b4ef4c46adc7b3af8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for django_zero_migrations_commands-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 162ae56f606772fb662a095b56d1029fd2964b3a908cd77be9490c1326d15a24
MD5 70f854cdf6893e56fe8930f1e08317a6
BLAKE2b-256 7c280894ee4b97591effb140e5692d7371405cf769403f2f0583c026db627878

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