Manual:Hooks/LoadExtensionSchemaUpdates/cs

Summary

 * 1) Create your hook as indicated below. The example shows how to setup the hook function. If you have more than one schema update, you can put them in the same function. Make sure you are using the methods with Extension in the name to register the updates, rather than execute them directly.
 * 2) Make sure the hook has access to any necessary SQL files, which are usually located in an   directory.
 * 3) Format the SQL files correctly.  See the, and the corresponding , for some examples.
 * 4) From the command line run the   script to update your wiki’s database with your extension’s   hook. See the  manual for more information.

>= 1.25
Extension registration was introduced in MW 1.25, and so the Hooks section of  should be used instead of. For example:

And in :

The code of the hook callback is the same as for earlier versions (see below).