openchs-models 1.31.52 → 1.31.54

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.
Files changed (2) hide show
  1. package/dist/Schema.js +4 -1
  2. package/package.json +1 -1
package/dist/Schema.js CHANGED
@@ -277,6 +277,8 @@ function migrateEmbeddedObjects(oldDB, newDB) {
277
277
  newDB.deleteModel("StringKeyNumericValue");
278
278
  }
279
279
 
280
+ const VersionWithEmbeddedMigrationProblem = 185;
281
+
280
282
  function createRealmConfig() {
281
283
  return {
282
284
  shouldCompact: function (totalBytes, usedBytes) {
@@ -288,6 +290,7 @@ function createRealmConfig() {
288
290
  schemaVersion: 186,
289
291
  onMigration: function (oldDB, newDB) {
290
292
  console.log("[AvniModels.Schema]", `Running migration with old schema version: ${oldDB.schemaVersion} and new schema version: ${newDB.schemaVersion}`);
293
+ if (oldDB.schemaVersion === VersionWithEmbeddedMigrationProblem) throw new Error(`Update from schema version ${VersionWithEmbeddedMigrationProblem} is not allowed. Please uninstall and install app.`);
291
294
 
292
295
  if (oldDB.schemaVersion < 10) {
293
296
  const oldObjects = oldDB.objects("DecisionConfig");
@@ -898,7 +901,7 @@ function createRealmConfig() {
898
901
  migrateEmbeddedObjects(oldDB, newDB);
899
902
  }
900
903
 
901
- if (oldDB.schemaVersion < 185) {// removed migration code. keeping the version number in case this number is required for any checks later
904
+ if (oldDB.schemaVersion < VersionWithEmbeddedMigrationProblem) {// removed migration code. keeping the version number in case this number is required for any checks later
902
905
  }
903
906
  }
904
907
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "openchs-models",
3
3
  "description": "OpenCHS data model to be used by front end clients",
4
- "version": "1.31.52",
4
+ "version": "1.31.54",
5
5
  "private": false,
6
6
  "repository": {
7
7
  "type": "git",