[odb-users] Altering column from integer to double precision

Boris Kolpackov boris at codesynthesis.com
Sat Aug 16 08:13:27 EDT 2014


Hi Philip,

Philip Ethier <philip.ethier at gmail.com> writes:

> I was trying to use the void schema_version_migration() function to set
> my version, but it doesn't seem to be persisting even though no exceptions
> are thrown.

The schema_version_migration() modifier does not persist anything. It
simply stores the version in the odb::<db>::database instance so that
it can be used by the generated code during the execution of the
application. Quoting Section 12.2:

"You may already have a version table in your database or you (or your
 database administrator) may prefer to keep track of versions your own
 way. You can instruct ODB not to create the schema_version table with the
 --suppress-schema-version option. However, ODB still needs to know the
 current database version in order for certain schema evolution mechanisms to
 function properly. As a result, in this case, you will need to set the schema
 version on the database instance manually using the
 schema_version_migration() modifier."

The version and the migration flags are only "persisted" by the pre- and
post-schema migration scripts. Which means that if you run your own
custom script instead, then you have to update the version as well.

Boris



More information about the odb-users mailing list