SEBA-463 Submit migration scripts from sync to core, use instead of autogenned
Change-Id: I9e46b068caf97082c27d6f910f0961ccd5d10c2f
diff --git a/lib/xos-synchronizer/xossynchronizer/loadmodels.py b/lib/xos-synchronizer/xossynchronizer/loadmodels.py
index 7e82ac9..78fa1a6 100644
--- a/lib/xos-synchronizer/xossynchronizer/loadmodels.py
+++ b/lib/xos-synchronizer/xossynchronizer/loadmodels.py
@@ -57,4 +57,13 @@
item.filename = fn
item.contents = open(os.path.join(api_convenience_dir, fn)).read()
+ # migrations directory is a sibling to the models directory
+ migrations_dir = os.path.join(dir, "..", "migrations")
+ if os.path.exists(migrations_dir):
+ for fn in os.listdir(migrations_dir):
+ if fn.endswith(".py") and "test" not in fn:
+ item = request.migrations.add()
+ item.filename = fn
+ item.contents = open(os.path.join(migrations_dir, fn)).read()
+
result = self.api.dynamicload.LoadModels(request)