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.
- package/dist/Schema.js +4 -1
- 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 <
|
|
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
|
};
|