openchs-models 1.31.46 → 1.31.48
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 -5
- package/package.json +1 -1
package/dist/Schema.js
CHANGED
|
@@ -369,6 +369,11 @@ function migrateAllEmbeddedForTxnData(oldDB, newDB) {
|
|
|
369
369
|
|
|
370
370
|
function createRealmConfig() {
|
|
371
371
|
return {
|
|
372
|
+
shouldCompact: function (totalBytes, usedBytes) {
|
|
373
|
+
const doCompact = totalBytes / usedBytes > 1.1;
|
|
374
|
+
console.log("Should compact", totalBytes, usedBytes, doCompact);
|
|
375
|
+
return doCompact;
|
|
376
|
+
},
|
|
372
377
|
//order is important, should be arranged according to the dependency
|
|
373
378
|
schemaVersion: 187,
|
|
374
379
|
onMigration: function (oldDB, newDB) {
|
|
@@ -980,11 +985,10 @@ function createRealmConfig() {
|
|
|
980
985
|
migrateAllEmbeddedForTxnData(oldDB, newDB);
|
|
981
986
|
}
|
|
982
987
|
|
|
983
|
-
if (oldDB.schemaVersion < 186) {
|
|
984
|
-
newDB.deleteModel("
|
|
985
|
-
newDB.deleteModel("
|
|
986
|
-
newDB.deleteModel("
|
|
987
|
-
newDB.deleteModel("ProgramOutcome");
|
|
988
|
+
if (oldDB.schemaVersion < 186) {// newDB.deleteModel("UserDefinedIndividualProperty");
|
|
989
|
+
// newDB.deleteModel("ConfigFile");
|
|
990
|
+
// newDB.deleteModel("Decision");
|
|
991
|
+
// newDB.deleteModel("ProgramOutcome");
|
|
988
992
|
}
|
|
989
993
|
}
|
|
990
994
|
};
|