Wikibase
MediaWiki Wikibase extension
Loading...
Searching...
No Matches
Wikibase\Repo\Store\Sql\DatabaseSchemaUpdater Class Reference

Public Member Functions

 __construct (Store $store)
 
 doSchemaUpdate (DatabaseUpdater $updater)
 

Static Public Member Functions

static onSchemaUpdate (DatabaseUpdater $updater)
 Schema update to set up the needed database tables.
 
static rebuildPropertyInfo (DatabaseUpdater $updater)
 Wrapper for invoking PropertyInfoTableBuilder from DatabaseUpdater during a database update.
 
static rebuildPropertyTerms (DatabaseUpdater $updater)
 
static rebuildItemTerms (DatabaseUpdater $updater)
 

Private Member Functions

 addChangesTable (DatabaseUpdater $updater, $type)
 
 updateItemsPerSiteTable (DatabaseUpdater $updater, IDatabase $db)
 
 updateChangesTable (DatabaseUpdater $updater, IDatabase $db)
 
 registerPropertyInfoTableUpdates (DatabaseUpdater $updater)
 
 getUpdateScriptDir ( $fileName)
 Returns the script directory that contains a file with the given name.
 
 getUpdateScriptPath ( $name, $type)
 Returns the appropriate script file for use with the given database type.
 
 updateTermsTable (DatabaseUpdater $updater, IDatabase $db)
 Applies updates to the wb_terms table.
 

Static Private Member Functions

static newFromGlobalState ()
 
static newItemIdIterator (int $highestId)
 

Private Attributes

 $store
 

Detailed Description

Author
Daniel Kinzler
Marius Hoch

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Repo\Store\Sql\DatabaseSchemaUpdater::__construct ( Store  $store)

Member Function Documentation

◆ addChangesTable()

Wikibase\Repo\Store\Sql\DatabaseSchemaUpdater::addChangesTable ( DatabaseUpdater  $updater,
  $type 
)
private
Parameters
DatabaseUpdater$updater
string$type

◆ doSchemaUpdate()

Wikibase\Repo\Store\Sql\DatabaseSchemaUpdater::doSchemaUpdate ( DatabaseUpdater  $updater)

◆ getUpdateScriptDir()

Wikibase\Repo\Store\Sql\DatabaseSchemaUpdater::getUpdateScriptDir (   $fileName)
private

Returns the script directory that contains a file with the given name.

Parameters
string$fileNamewith extension
Exceptions
MWExceptionIf the file was not found in any script directory
Returns
string The directory that contains the file

◆ getUpdateScriptPath()

Wikibase\Repo\Store\Sql\DatabaseSchemaUpdater::getUpdateScriptPath (   $name,
  $type 
)
private

Returns the appropriate script file for use with the given database type.

Searches for files with type-specific extensions in the script directories, falling back to the plain ".sql" extension if no specific script is found.

Parameters
string$namethe script's name, without file extension
string$typethe database type, as returned by IDatabase::getType()
Returns
string The path to the script file
Exceptions
MWExceptionIf the script was not found in any script directory

◆ newFromGlobalState()

static Wikibase\Repo\Store\Sql\DatabaseSchemaUpdater::newFromGlobalState ( )
staticprivate

◆ newItemIdIterator()

static Wikibase\Repo\Store\Sql\DatabaseSchemaUpdater::newItemIdIterator ( int  $highestId)
staticprivate

◆ onSchemaUpdate()

static Wikibase\Repo\Store\Sql\DatabaseSchemaUpdater::onSchemaUpdate ( DatabaseUpdater  $updater)
static

Schema update to set up the needed database tables.

See also
https://www.mediawiki.org/wiki/Manual:Hooks/LoadExtensionSchemaUpdates
Parameters
DatabaseUpdater$updater
Returns
bool

◆ rebuildItemTerms()

static Wikibase\Repo\Store\Sql\DatabaseSchemaUpdater::rebuildItemTerms ( DatabaseUpdater  $updater)
static

◆ rebuildPropertyInfo()

static Wikibase\Repo\Store\Sql\DatabaseSchemaUpdater::rebuildPropertyInfo ( DatabaseUpdater  $updater)
static

Wrapper for invoking PropertyInfoTableBuilder from DatabaseUpdater during a database update.

Parameters
DatabaseUpdater$updater

◆ rebuildPropertyTerms()

static Wikibase\Repo\Store\Sql\DatabaseSchemaUpdater::rebuildPropertyTerms ( DatabaseUpdater  $updater)
static

◆ registerPropertyInfoTableUpdates()

Wikibase\Repo\Store\Sql\DatabaseSchemaUpdater::registerPropertyInfoTableUpdates ( DatabaseUpdater  $updater)
private

◆ updateChangesTable()

Wikibase\Repo\Store\Sql\DatabaseSchemaUpdater::updateChangesTable ( DatabaseUpdater  $updater,
IDatabase  $db 
)
private

◆ updateItemsPerSiteTable()

Wikibase\Repo\Store\Sql\DatabaseSchemaUpdater::updateItemsPerSiteTable ( DatabaseUpdater  $updater,
IDatabase  $db 
)
private

◆ updateTermsTable()

Wikibase\Repo\Store\Sql\DatabaseSchemaUpdater::updateTermsTable ( DatabaseUpdater  $updater,
IDatabase  $db 
)
private

Applies updates to the wb_terms table.

Parameters
DatabaseUpdater$updater
IDatabase$db

Member Data Documentation

◆ $store

Wikibase\Repo\Store\Sql\DatabaseSchemaUpdater::$store
private

The documentation for this class was generated from the following file: