Manual:Hooks/LoadExtensionSchemaUpdates

summary

 * 1) create your hook as indicated below
 * 2) make sure the hook has access to any necessary sql files
 * 3) format the sql files according to 
 * 4) from the command line run the   script to update your wiki’s database with your extension’s   hook
 * 5) see the update.php manual for more information

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.

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.

Note: Be very careful about the last member of the array being true. If you pass it an absolute path and nothing else, it will treat the path as relative to maintenance/archives and you will get all manner of errors.

<= 1.16 and >= 1.17 dual support
It is possible to provide support for both older versions of MediaWiki, and the current versions without much extra effort required

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. For an example, see the FlaggedRevs extension.

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.