Manual:Hooks/LoadExtensionSchemaUpdates

Usage
If your extension requires changes to the database when MediaWiki is updated, do it with this hook. Users can then update their wiki by running update.php

To add a new table
To add a new table, in the main file for your extension: The  file should contain the necessary   table definition.

To add a table and/or modify a field
If your extension has already added a table, but you need to modify a field in it for a new version, make the change in the sql file for the table (for people installing the extension after the change), then make a "patch" sql file to modify the field in the table (for people updating from an older version).

The  file should contain the necessary   statement to update old versions of the schema.