Checks whether there are any changes to migrate in Django.
This repository contains two hooks:
- Check (
manage.py makemigrations --check
) - Dry-run (
manage.py makemigrations --dry-run
)
You should specify which hook to use in your pre-commit configuration.
The check hook will return an error code if there are any changes to migrate, preventing the deveplers to commit unless migrations for all changes are present in the commit.
repos:
- repo: https://github.com/potasiak/pre-commit-django-makemigrations
rev: main
hooks:
- id: django-makemigrations-check
The dry-run hook will not return an error code even when there are changes to migrate but will still display the changes that have to be migrated. It won't stop the developers from commiting without migrations for all changes.
repos:
- repo: https://github.com/potasiak/pre-commit-django-makemigrations
rev: main
hooks:
- id: django-makemigrations-dry-run