openchs-models 1.31.71 → 1.31.72
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Schema.js +9 -1
- package/package.json +1 -1
package/dist/Schema.js
CHANGED
|
@@ -281,7 +281,7 @@ function createRealmConfig() {
|
|
|
281
281
|
return doCompact;
|
|
282
282
|
},
|
|
283
283
|
//order is important, should be arranged according to the dependency
|
|
284
|
-
schemaVersion:
|
|
284
|
+
schemaVersion: 189,
|
|
285
285
|
onMigration: function (oldDB, newDB) {
|
|
286
286
|
console.log("[AvniModels.Schema]", `Running migration with old schema version: ${oldDB.schemaVersion} and new schema version: ${newDB.schemaVersion}`);
|
|
287
287
|
if (oldDB.schemaVersion === VersionWithEmbeddedMigrationProblem) throw new Error(`Update from schema version ${VersionWithEmbeddedMigrationProblem} is not allowed. Please uninstall and install app.`);
|
|
@@ -903,6 +903,14 @@ function createRealmConfig() {
|
|
|
903
903
|
// newDB.deleteModel("Decision");
|
|
904
904
|
// newDB.deleteModel("ProgramOutcome");
|
|
905
905
|
}
|
|
906
|
+
|
|
907
|
+
if (oldDB.schemaVersion < 189) {
|
|
908
|
+
_lodash.default.forEach(newDB.objects("SubjectType"), subjectType => {
|
|
909
|
+
if (!subjectType.settings) {
|
|
910
|
+
subjectType.settings = '{}';
|
|
911
|
+
}
|
|
912
|
+
});
|
|
913
|
+
}
|
|
906
914
|
}
|
|
907
915
|
};
|
|
908
916
|
}
|