Jumoo / uSyncMigrations

Rough and ready migration code.
Mozilla Public License 2.0
44 stars 57 forks source link

Migrating Archetype can finish with lost data if notmergable properties are used #236

Open bielu opened 10 months ago

bielu commented 10 months ago

So based on experience in last project, I just found that we missing some type of validation which would check if alias for new block can be match in migrated doctypes.

Example of case: 3 archetypes blocks with same alias, lets be it cta 3 doctypes: HomePage, ContentPage, ArticlePage configuration as followed:

 "Archetype": {
        "NotMergableDocumentTypes": [
          "cta"
        ],
        "RenamedDocumentTypesAliases": {
          "ctaPaneIHomepagePanels": "ctaHomePage",
          "ctaPanelContentPanels": "ctaContentPage",
          "image": "imagePane",
          "loginArea": "loginAreaPanel",
          "form": "formItem"
        }
      },

the issue is caused by renaming target alias, but we should have some validation in place to throw information in migration log that we have missing target :)