MediaWiki file: DatabaseUpdater.php
Location: includes/installer/
Source code: master 1.40.0 1.39.4 1.35.11
Classes: DatabaseUpdater

DatabaseUpdater is the class for handling database updates (e.g. adding, modifying, and dropping database tables, fields, and indexes). 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.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 LoadExtensionSchemaUpdates hook functions. Either way, SQL patch file(s) need to be created.

Functions

  • addExtensionField( $tableName, $columnName, $sqlPath )
  • addExtensionIndex( $tableName, $indexName, $sqlPath )
  • addExtensionTable( $tableName, $sqlPath )
  • addExtensionUpdate( array $update )
  • addPostDatabaseUpdateMaintenance( $class )
  • doUpdates( array $what = [ 'core', 'extensions', 'stats' ] )
  • dropExtensionField( $tableName, $columnName, $sqlPath )
  • dropExtensionIndex( $tableName, $indexName, $sqlPath )
  • dropExtensionTable( $tableName, $sqlPath = false )
  • getDB()
  • getPostDatabaseUpdateMaintenance()
  • getSchemaVars()
  • insertUpdateRow( $key, $val = null )
  • modifyExtensionField( $tableName, $fieldName, $sqlPath )
  • modifyExtensionTable( $tableName, $sqlPath )
  • output( $str )
  • patchPath( IDatabase $db, $patch )
  • purgeCache()
  • renameExtensionIndex( $tableName, $oldIndexName, $newIndexName,
  • setAutoExtensionHookContainer( HookContainer $hookContainer )
  • setFileAccess()
  • tableExists( $tableName )
  • updateRowExists( $key )
This article is issued from Mediawiki. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.