...
To implement a schema level update, two steps must be taken:
The new numeric schema level must be specified in the plugin’s descriptor file.
The actual schema update must be implemented.
Define new schema level in plugin descriptor
...
Codeblock | ||
---|---|---|
| ||
{ "$schema": "http://git.intra.pinuts.de/cmsbs/cmsbs/raw/master/doc/json-schemas/plugin.desc.json", "__encoding": "Pinuts File Encoding: UTF-8", "name": "de.acme.projectxtutorial", ..., "dbSchema": 1 } |
Implement schema update
Create a new ES6 file in your plugin’s CSE directory. If your plugin’s name is de.acme.projectxtutorial
then cmsbs-conf/cse/plugins/de.acme.tutorial/callback/DbSchemaUpdate.mjs
would be a good choice:
...
There are several helper methods available to accomplish common tasks like adding or altering columns or executing custom SQL statements:
Hinweis |
---|
Please keep in mind that a database schema update cannot be undone automatically! Have a fresh backup at hand to be able to rollback the database if needed. |