ProjectDjango/Project.py

branch
eric7
changeset 203
07abb6af9048
parent 202
b06794ae2a92
child 204
ef2a6680ad2a
--- a/ProjectDjango/Project.py	Fri Dec 27 14:17:37 2024 +0100
+++ b/ProjectDjango/Project.py	Sat Dec 28 16:01:22 2024 +0100
@@ -8,6 +8,7 @@
 """
 
 import contextlib
+import glob
 import os
 import re
 import shutil
@@ -2869,6 +2870,17 @@
         res = dia.startProcess(args, path)
         if res:
             dia.exec()
+            if not dryRun:
+                # Append generated migrations only if no dry-run was done.
+                migrationFiles = glob.glob(
+                    os.path.join(
+                        self.__ericProject.getProjectPath(),
+                        "**/[0-9][0-9][0-9][0-9]*.py"
+                    ),
+                    recursive=True,
+                )
+                for migrationFile in migrationFiles:
+                    self.__ericProject.appendFile(migrationFile)
 
     def __squashMigrations(self):
         """

eric ide

mercurial