[odb-users] schema version vs object version.

Boris Kolpackov boris at codesynthesis.com
Tue Aug 29 05:51:12 EDT 2023


Anurag Gupta <anuragg at miltenyi.com> writes:

> I'm trying to use schema versioning and came across an interesting
> choice, can I use schema versioning (#pragma db model version (x, x))
> and at the same time I can version the objects (#pragma db object
> pointer (std::shared_ptr) version (x, x) )?

No, the `version` specifier is not valid for `#pragma db object`.


> what is the recommended way of dealing with object versions? Should
> they all be tied to model version?

Yes, you version the object model, not individual classes. The overall
idea and workflow is fairly thoroughly documented in the manual,
specifically chapter 13, "Database Schema Evolution":

https://www.codesynthesis.com/products/odb/doc/manual.xhtml#13

In particular, take a look at section 13.4, "Soft Object Model Changes",
maybe this is what you are looking for:

https://www.codesynthesis.com/products/odb/doc/manual.xhtml#13.4



More information about the odb-users mailing list