Skip to content

Commit 788930b

Browse files
committed
feat: sort migrations
1 parent 0a7a82e commit 788930b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

django_replace_migrations/management/commands/makemigrations.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,9 @@ def write_migration_files(self, changes, update_previous_migration_paths=None):
392392
migration_string = self.get_relative_path(writer.path)
393393
self.log(" %s\n" % self.style.MIGRATE_LABEL(migration_string))
394394
if self.replace_all:
395-
self.stdout.write(" Replaces '%s'." % migration.replaces)
395+
self.stdout.write(
396+
" Replaces '%s'." % sorted(migration.replaces)
397+
)
396398
for operation in migration.operations:
397399
self.log(" - %s" % operation.describe())
398400
if self.scriptable:
@@ -520,7 +522,7 @@ def all_items_equal(seq):
520522
{
521523
"dependencies": [
522524
(app_label, migration.name)
523-
for migration in merge_migrations
525+
for migration in sorted(merge_migrations)
524526
],
525527
},
526528
)

0 commit comments

Comments
 (0)