Django Migration Snapshots
Capture snapshots of your django project’s migration history. These snapshots are represented as a directed graph using pygraphviz in both textual and graphical formats.
Documentation
The full documentation is at https://django-migration-snapshots.readthedocs.io.
Quickstart
Install Django Migration Snapshots:
pip install django-migration-snapshots
Add it to your INSTALLED_APPS:
INSTALLED_APPS = (
...
"migration_snapshots",
...
)
1) Execute management command to create snapshot
# creates snapshot of entire migration history
python manage.py create_snapshot
# filter migrations before applied date (YYYY-MM-DD)
python manage.py create_snapshot --date="2022-10-15"
2) Create object programmatically or from the admin panel
MigrationSnapshot.objects.create(output_format="pdf")
3) Automatically create migration snapshots with the post_migrate signal
from django.apps import AppConfig
from django.db.models.signals import post_migrate
def my_snapshot_callback(sender, **kwargs):
# Create migration snapshot
MigrationSnapshot.objects.create(output_format="pdf")
class MyAppConfig(AppConfig):
...
def ready(self):
# send signal only once after all migrations execute
post_migrate.connect(my_snapshot_callback, sender=self)
Text Snapshot
digraph {
"admin/0001_initial" -> "auth/0001_initial"
"admin/0001_initial" -> "contenttypes/0001_initial"
"admin/0002_logentry_remove_auto_add" -> "admin/0001_initial"
"admin/0003_logentry_add_action_flag_choices" -> "admin/0002_logentry_remove_auto_add"
"auth/0001_initial" -> "contenttypes/0001_initial"
"auth/0002_alter_permission_name_max_length" -> "auth/0001_initial"
...
}
Graphical Snapshot
Features
MigrationSnapshot data model
Supported output formats
BMP, CGIMAGE, DOT_CANON, DOT, GV, XDOT, XDOT12, XDOT14, EPS, EXR, FIG, GD, GIF, GTK, ICO, CMAP, ISMAP, IMAP, CMAPX, IMAGE_NP, CMAPX_NP, JPG, JPEG, JPE, JPEG_2000, JSON, JSON0, DOT_JSON, XDOT_JSON, PDF, PIC, PICT, APPLE_PICT, PLAIN_TEXT, PLAIN_EXT, PNG, POV_RAY, PS_PDF, PSD, SGI, SVG, SVGZ, TGA, TIF, TIFF, TK, VML, VMLZ, VRML, WBMP, WEBP, XLIB, X11
View migration history based on the miigration’s applied timestamp
TODO’s
Additional test coverage
Setup tox
Additional filters in management command (ie; per app, per model, etc.)
Local Development
make install make test
Deployment
make build make deploy
License
This project is provided under the BSD License.
Metadata
Release files for django-migration-snapshots 0.5.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| django-migration-snapshots-0.5.1.tar.gz | 12.7 kB | Without provenance | Details for django-migration-snapshots-0.5.1.tar.gz |
Release files / django-migration-snapshots-0.5.1.tar.gz
| Download URL | django-migration-snapshots-0.5.1.tar.gz |
|---|---|
| Size | 12.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d7057cc9227a12b8a7333cd5ead3394197edd8190c54192b4c8e25516de2c2cc
|
|
BLAKE2b-256 checksum How to use checksums |
5b84cadfe82a024a5fa655456d59bf2ab7a3a995b2969db78092b81eb30f6673
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.4
|
Security for django-migration-snapshots 0.5.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.