Installation¶
Requirements¶
- Python 3.9+
- Django 3.2+
Install from PyPI¶
With PostgreSQL support¶
If you're using PostgreSQL and want to run integration tests:
Add to Django¶
Add django_safe_migrations to your INSTALLED_APPS:
# settings.py
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
# Add this
'django_safe_migrations',
# Your apps
'myapp',
]
Verify Installation¶
Run the management command:
You should see the command's help text listing the available options, including the output formats and flags:
usage: manage.py check_migrations [-h]
[--format {console,json,github,gitlab,sarif}]
[--output OUTPUT] [--fail-on-warning]
[--new-only] [--no-suggestions]
[--exclude-apps ...] [--include-django-apps]
[--diff] [--baseline BASELINE]
[--generate-baseline] [--interactive]
[--watch] [--list-rules] [--verbose]
[app_labels ...]
Check migrations for unsafe operations
...
Development Installation¶
For contributing or development: