Manual:DatabaseUpdater.php

From MediaWiki.org
Jump to: navigation, search

Other languages:
Deutsch • ‎English • ‎español • ‎français • ‎italiano • ‎日本語 • ‎polski • ‎português • ‎português do Brasil • ‎中文

DatabaseUpdater is the class for handling database updates (e.g. adding, modifying, and dropping database tables, fields, and indexes). MysqlUpdater.phpManual:MysqlUpdater.php, PostgresUpdater.php, SqliteUpdater.php, MssqlUpdater.php, and OracleUpdater.php extend this class, and all five of those files (as well as the tables.sqlManual:tables.sql files for the various database types) potentially need to be revised when a core schema change is made. Extensions usually change the schema by means of LoadExtensionSchemaUpdatesManual:Hooks/LoadExtensionSchemaUpdates hook functions. Either way, SQL patch file(s) need to be created.

Functions[edit]

  • addExtensionField ($tableName, $columnName, $sqlPath)
  • addExtensionIndex ($tableName, $indexName, $sqlPath)
  • addExtensionTable ($tableName, $sqlPath)
  • addExtensionUpdate (array $update)
  • addPostDatabaseUpdateMaintenance ($class)
  • dropExtensionField ($tableName, $columnName, $sqlPath)
  • dropExtensionIndex ($tableName, $indexName, $sqlPath)
  • dropExtensionTable ($tableName, $sqlPath)
  • dropTable ($table, $patch=false, $fullpath=false)
  • getDB ()
  • modifyExtensionField ($tableName, $fieldName, $sqlPath)
  • modifyField ($table, $field, $patch, $fullpath=false)
DatabasesManual:Database layout Engines: MySQL/MariaDBManual:MySQLOracleManual:OraclePostgreSQLManual:PostgreSQLSQLiteManual:SQLiteSQL ServerManual:Microsoft SQL Server

Technical documentation: SchemaManual:Database layout (tablesCategory:MediaWiki database tables) – API property associationsAPI:Database field and API property associationsField prefixesDatabase field prefixesPrimary key storage in other fieldsManual:Primary key storage in other fieldsWikimedia extension tablesCategory:Wikimedia extension database tables
Configuration: SettingsManual:Configuration_settings#Database_settingsSharingManual:Shared database
Development: AccessManual:Database accessOptimizationDatabase optimizationPolicyDevelopment policy#Database_patchesUpdaterManual:DatabaseUpdater.phpExtension schema updatesManual:Hooks/LoadExtensionSchemaUpdatesPatch fileManual:SQL patch file

Core tables: archivebot_passwordscategorycategorylinkschange_tagconfigexternallinksfilearchivehitcounterimageimagelinksinterwikiiwlinksipblocksjobl10n_cachelanglinkslogginglog_searchmsg_resourcemsg_resource_linksmodule_depsobjectcacheoldimagepagepagelinkspage_propspage_restrictionsprotected_titlesquerycachequerycachetwoquerycache_inforecentchangesredirectrevisionsearchindexsitessite_identifiers - site_statstag_summarytemplatelinkstexttranscacheupdateloguploadstashuseruser_former_groupsuser_groupsuser_newtalkuser_propertiestag_summaryvalid_tagwatchlist