Child pages
  • Maintenance Mode

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Using the maintenance plugin it is possible to programmatically modify the database structure. You can create and drop tables, and you can create and delete columns. Please refer to the API documentation of the maintenance plugin for specific details on how to do all these operations.

It can happen that when you move upgrade your Servoy solution, you need to change the structure of the underlying database. Some columns may become obsolete, new columns may be needed, data may need to be reorganized, etc. You can automate all these tasks by using the maintenance plugin in a pre-import hook.

...

The function tries to obtain a reference to the server where the table is stored. If successful, then it tries to obtain a reference to the table which holds the obsolete column. If this step is also successful, then it deletes the column. In order to make the change permanent, the table must be synchronized with the underlying database.

In pre-import and post-import hooks, besides changing the database structure, you can also change the database content. This is done in the classical way, by using the foundset API.