-
-
Save rvause/0658e8ad65b3eb436498f9d17d69db50 to your computer and use it in GitHub Desktop.
django-tips-blog-migration-manifest
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def handle(self, *app_labels, **options): | |
# Generate a migrations manifest with latest migration on each app | |
super(Command, self).handle(*app_labels, **options) | |
loader = MigrationLoader(None, ignore_no_migrations=True) | |
with open("latest_migrations.manifest", 'w') as f: | |
f.write("\n".join(sorted(f"{a}: {m}" for a, m in loader.graph.leaf_nodes()))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment