ocpp 0.24.1
A C++ implementation of the Open Charge Point Protocol
Public Member Functions | List of all members
ocpp::common::DatabaseSchemaUpdater Class Reference

Public Member Functions

 DatabaseSchemaUpdater (DatabaseConnectionInterface *database) noexcept
 Class that can apply migration files to a database to update the schema. More...
 
bool apply_migration_files (const fs::path &migration_file_directory, uint32_t target_schema_version)
 Apply migration files to a database to update the schema. More...
 

Constructor & Destructor Documentation

◆ DatabaseSchemaUpdater()

ocpp::common::DatabaseSchemaUpdater::DatabaseSchemaUpdater ( DatabaseConnectionInterface database)
explicitnoexcept

Class that can apply migration files to a database to update the schema.

Parameters
databaseInterface for the database connection

Member Function Documentation

◆ apply_migration_files()

bool ocpp::common::DatabaseSchemaUpdater::apply_migration_files ( const fs::path &  migration_file_directory,
uint32_t  target_schema_version 
)

Apply migration files to a database to update the schema.

Parameters
sql_migration_files_pathFilesystem path to migration file folder
target_schema_versionThe target schema version of the database
Returns
True if migrations applied successfully, false otherwise. Database is not modified when the migration fails.

The documentation for this class was generated from the following files: