Missing version number in import/export


We should have a base class implementing an inner node version.
Closed May 14, 2013 at 8:16 PM by sebastienros


CSADNT wrote Apr 1, 2013 at 9:02 AM

Adding 2 virtual methods in ContentPartDriver<> to WriteSchemaVersion and ReadSchemaVersion would simply do it. The Importing will receive as a new parameter the version read and maintain compatibility code... nothing broken.

sebastienros wrote Apr 16, 2013 at 7:33 PM

We don't understand what version you are talking about. Could you give us an example ?

CSADNT wrote Apr 16, 2013 at 8:30 PM

Something as in migration but in code, no nee for db.
Export write a versinned xml structure, the the last structure version, just a node name <version> with a number.
If you need to change something in the part, you increment the export version numer and write new struct.

Import reads all the versions, keeping the history, could be just a switch case based on the version node value.
We could say that the old import will be version 0, the new versionned import will contain an int parameter, the version.

CSADNT wrote Apr 17, 2013 at 4:15 PM

Sorry for bad writing from mobile, hope this is still understandable

CSADNT wrote Apr 17, 2013 at 4:33 PM

<Name>Generated by Orchard.ImportExport</Name>
<Orders version='2' />
<TheThing version='10' />