![]() |
Leosac
0.8.0
Open Source Access Control
|
A quick explanation about database versioning in Leosac.
Database version is a complicated tasks. We rely on our Object Relational Mapper, ODB, to provide infrastructure to support database versioning.
ODB maintains a changelog of the database structure. This changelog is committed in the repository and is required to properly track change and support automatic database migration.
ODB comes with per-schema versioning, which allows use to make use of powerful versioning strategy.
ODB comes with per-schema versioning. This means the same database can have multiple versions at the same.
Leosac makes use of this, by defining multiple schemas:
core schema is managed by the core Leosac program. It includes Users, Groups, Credentials, and a lot of user object. module-MODULE_NAME. The database.hpp uses a pragma db model version(x, y) so that we can define Leosac's core schema version.
It is important for module code to define ODB_NO_BASE_VERSION before including any file that could include database.hpp. Defining ODB_NO_BASE_VERSION will prevent the use of pragma db model version(x, y) and will allows module code to pick it's own version.