Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when rerunning a migration for a type that uses a reusable schema #320

Open
twozero6 opened this issue Dec 16, 2024 · 0 comments
Open

Comments

@twozero6
Copy link

When working with any significant migration we need the ability to rerun the migration, just like we can without using custom class mappings, or when using UMT. It enables fixing issues and rerunning it without having to start over.
Furthermore, without this, there's no chance we could migrate delta content changes, even if we used the approach of rerunning in an empty database, serialize to CI, and merging CI changes.

It gives us the impression that there's a case where Guid.NewGuid() is being used when migrating content like maybe here. But, it would be better to require us to provide a static Guid -- one that would be the same with every migration runs.

This issue is a significant hinderance to using one of the most powerful features -- custom class mapping.

I have a custom ClassMapping class for several page\content types. Those types have multiple reusable schemas as well as standalone fields.

After I run the migration for the first time, the pages of those types work fine in the content tree.
After I run the migration for the second time, the pages show "Something went wrong!" with this error in the Event Log:

An unhandled exception has occurred while executing the request.
Message: An item with the same key has already been added. Key: ReusablePageTitle

Every field in the mapping class for the Reusable Schemas and every field in the Types using those schemas have a unique but static GUID assigned to them. The types themselves also have a unique but static GUID.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant