Creating new tables

From Wikitech
Jump to navigation Jump to search

Creating new tables in MediaWiki is a distinct process from making changes to existing table schemas.

For a core table that doesn't exist on an individual wiki, you can use:

mwscript sql.php --wiki=wikidbname maintenance/patches/whatever.sql

If you want to add the table across the entire cluster, instead you can use:

foreachwiki sql.php maintenance/patches/whatever.sql

When added an extension to a wiki, you can use:

mwscript extensions/WikimediaMaintenance/createExtensionTables.php --wiki=wikidbname extension

Wikireplica actions when creating new wikis or tables

For Wikimedia Servers, unless the tables are clearly all public data, they still need a heads up to DBAs to setup the appropriate filters on wikireplicas- this should had happened normally during design phase. The tables do not appear automatically on labs, so there is no need to be blocked by this -a ticket or CC on an existing one is enough-, however new tables appearing without sysadmins knowing how can lead to confusion. Also they may be needed to be available on wikireplicas and that requires manual action.