[odb-users] Re: odb compiler schema generation issue

Boris Kolpackov boris at codesynthesis.com
Mon Feb 19 07:25:13 EST 2024


Michael Martin Moro <sexymimi64 at gmail.com> writes:

> After all this time, I'm finally realizing that:
> 
> #pragma db model version(x,x)
> 
> Needs to be specified somewhere in order for an xml changelog to be
> generated.

Right, this is actually documented in the manual, Section 13.1,
"Object Model Version and Changelog":

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

"Once we specify the object model version, the ODB compiler starts tracking
database schema changes in a changelog file. Changelog has an XML-based,
line-oriented format. It uses XML in order to provide human readability while
also facilitating, if desired, processing and analysis with custom tools. The
line orientation makes it easy to review with tools like diff.

The changelog is maintained by the ODB compiler. Specifically, you do not need
to make any manual changes to this file. You will, however, need to keep it
around from one invocation of the ODB compiler to the next. In other words,
the changelog file is both the input and the output of the ODB compiler. This,
for example, means that if your project's source code is stored in a version
control repository, then you will most likely want to store the changelog
there as well. If you delete the changelog, then any ability to do schema
migration will be lost.

The only operation that you may want to perform with the changelog is to
review the database schema changes that resulted from the C++ object model
changes. For this you can use a tool like diff or, better yet, the change
review facilities offered by your revision control system. For this purpose
the contents of a changelog will be self-explanatory."

But I am glad you sorted yourself out.



More information about the odb-users mailing list