[odb-users] Issue wth migration of std.array newly added members

OLBINSKI Gracjan gracjan.olbinski-ext at hexagon.com
Tue Jun 3 04:07:28 EDT 2025


Dear ODB Support Team,
I’m experiencing a problem during schema migration involving a newly added std::array<double, 3> data member.
Here’s the situation:

  1.  I have an object stored in the database under schema version 41.
  2.  In version 42, I introduced a new data member of type std::array<double, 3>, which shall be initialized to {0, 0, 0} by default.
  3.  During the migration process, ODB correctly creates the shadow table for the object, but it remains empty after migration.
  4.  When attempting to load objects from the migrated database in a debug build, the application fails with an assertion in std_array_traits.hxx:50, which checks that all array elements are properly populated from the database.
  5.  Due to this assertion failure, it’s not possible to manually complete the migration by inserting the missing values into the shadow table, as the application crashes (due to assertion) before any such logic can be executed.

The only workaround that I can think of is execution of raw sql statement via db->execute() api to insert missing rows to shadow table.
Is this a known issue, and is there a recommended approach for handling std::array additions in schema evolution?
Thank you for your assistance.
Best regards,
Gracjan Olbinski


More information about the odb-users mailing list