You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some times we need to change DB schema. For instance add new field or even a new table connected by some index with another table.
Currently we are not storing schema version in .db3 file and it's very difficult to support backward compatibility in case of changing DB schema.
We need to store DB schema version in .db3 file directly to be able properly read out bag files with different versions.
Creating new table in database for storing DB schema version in it.
We decided to go with second option because builtin pragma schema version is intended for internal usage by sqlite engine and supposed to be incremented by sqlite engine when doing internal operations on database. There are some notes in description that changing those value could lead to the undefined behavior.
One more argument towards to the second option is that we can store metadata version in the same table as well.
Will need to add coverage in unit tests to make sure that bag files created with previous version of the schema layout supported. i.e. possible to create, open reader and read messages from it.
The text was updated successfully, but these errors were encountered:
Description
Some times we need to change DB schema. For instance add new field or even a new table connected by some index with another table.
Currently we are not storing schema version in .db3 file and it's very difficult to support backward compatibility in case of changing DB schema.
We need to store DB schema version in .db3 file directly to be able properly read out bag files with different versions.
Related Issues
Related to the #1086
Completion Criteria
Implementation Notes / Suggestions
On "Rosbag2 and Tooling WG meeting" from 2022-09-23 we discussed possible implementation and considered 2 options for storing db schema.
We decided to go with second option because builtin pragma schema version is intended for internal usage by sqlite engine and supposed to be incremented by sqlite engine when doing internal operations on database. There are some notes in description that changing those value could lead to the undefined behavior.
One more argument towards to the second option is that we can store metadata version in the same table as well.
Presumably will need to add new table in SqliteStorage::Initialize() method.
Testing Notes / Suggestions
Will need to add coverage in unit tests to make sure that bag files created with previous version of the schema layout supported. i.e. possible to create, open reader and read messages from it.
The text was updated successfully, but these errors were encountered: