Database Patching
Some plugins may require special indexing and/or patches to the underlying SanteDB schema. While this is generally not recommended (you should attempt to use the built-in RIM concepts), there are occasions where your plugin will need to touch the database.
Patch SQL Files
Patching is done by including SQL files in your project as an Embedded Resource. The files should end in the extension .SQL and must contain a header with the following format:
When writing FirebirdSQL patches you should add FROM RDB$DATABASE to the ck_patch and reg patch functions such as SELECT REG_PATCH('MYPATCH') FROM RDB$DATABASE;
The SanteDB updater config tool will read these manifests and allow the system administrator an option to install your patches to their database.
The schema is as follows:
Auto-Deploy of Patches
You should set your SQL file's compile action to EmbeddedResource
in your plugin. Upon service start (on Windows, Linux, Android, or Docker) your SQL patch file will be executed and the database migrated.
Last updated