openchs-models 1.33.19 → 1.33.20

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.
@@ -55,10 +55,7 @@ workflows:
55
55
  version: 2
56
56
  test_deploy:
57
57
  jobs:
58
- - build:
59
- filters:
60
- tags:
61
- only: /^v.*/
58
+ - build
62
59
  # - publish:
63
60
  # requires:
64
61
  # - build
package/dist/Schema.js CHANGED
@@ -177,7 +177,7 @@ function createRealmConfig() {
177
177
  return doCompact;
178
178
  },
179
179
  //order is important, should be arranged according to the dependency
180
- schemaVersion: 204,
180
+ schemaVersion: 205,
181
181
  onMigration: function (oldDB, newDB) {
182
182
  console.log("[AvniModels.Schema]", `Running migration with old schema version: ${oldDB.schemaVersion} and new schema version: ${newDB.schemaVersion}`);
183
183
  if (oldDB.schemaVersion === VersionWithEmbeddedMigrationProblem) throw new Error(`Update from schema version ${VersionWithEmbeddedMigrationProblem} is not allowed. Please uninstall and install app.`);
@@ -760,6 +760,19 @@ function createRealmConfig() {
760
760
  }
761
761
  });
762
762
  }
763
+ if (oldDB.schemaVersion < 205) {
764
+ _lodash.default.forEach(newDB.objects("Concept"), concept => {
765
+ const oldConcept = oldDB.objects("Concept").filtered(`uuid = "${concept.uuid}"`)[0];
766
+ if (oldConcept && oldConcept.mediaUrl && oldConcept.mediaType) {
767
+ const conceptMedia = {
768
+ uuid: _General.default.randomUUID(),
769
+ url: oldConcept.mediaUrl,
770
+ type: oldConcept.mediaType
771
+ };
772
+ concept.media.push(conceptMedia);
773
+ }
774
+ });
775
+ }
763
776
  }
764
777
  };
765
778
  }
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.33.19",
4
+ "version": "1.33.20",
5
5
  "private": false,
6
6
  "repository": {
7
7
  "type": "git",