-
Notifications
You must be signed in to change notification settings - Fork 228
WIP - Major change to dynamic schema fails schema import #8164
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
base: master
Are you sure you want to change the base?
WIP - Major change to dynamic schema fails schema import #8164
Conversation
// Now try to delete a property 'PropToDelete' in a major schema update on a dynamic schema (should succeed) | ||
try { | ||
await testImodel.importSchemaStrings([`<?xml version="1.0" encoding="utf-8" ?> | ||
<ECSchema schemaName="TestSchema" alias="ts" version="2.0.1" xmlns="http://www.bentley.com/schemas/Bentley.ECXML.3.2"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Though this did not work as well. But my understanding is that dynamic schema does not require major version on schema to change to make major version change. That why we have flag AllowMajorSchemaUpgradeForDynamicSchemas
other wise why we have this flag.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note another case is that the stored schema that got upgraded was of ECXML 2.0
Id Name DisplayLabel Description Alias VersionDigit1 VersionDigit2 VersionDigit3 OriginalECXmlVersionMajor OriginalECXmlVersionMinor
-- ------------ ------------ ----------- ----- ------------- ------------- ------------- ------------------------- -------------------------
42 OpenPlant_3D OpenPlant_3D (null) op3d 1 0 3843 2 0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I exported and then imported it again with delete properties. I did follow two both failed where i got error that schema upgrade failed.
- I exported from iModelConsole it seems to export with ECXML.3.1
- I exported from itwin.js using exportSchemas() it exported with ECXML 3.2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me know if this helps you reproduce it. I have a dataset and schema on disk so maybe you can use that to reproduce it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Though this did not work as well. But my understanding is that dynamic schema does not require major version on schema to change to make major version change. That why we have flag
AllowMajorSchemaUpgradeForDynamicSchemas
other wise why we have this flag.
Not quite.
We have a blanket ban on all major version changes with the DisallowMajorSchemaUpgrade flag in iModelPlatform.
We relaxed this only for dynamic schemas.
The flag "AllowMajorSchemaUpgradeForDynamicSchemas" (defaults to true) was just to have some added control over dynamic schema major upgrades to disable/re-enable it in the future.
However, the general rules of major version change like incrementing read version are still in effect for all dynamic and non-dynamic schemas.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have made the change to allow dynamic schemas to make major changes without requiring a read version increment.
Native PR: iTwin/imodel-native#1144
drafting while still wip |
Fixes https://github.com/iTwin/itwinjs-backlog/issues/1517
WIP