X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2Finstaller%2FDatabaseUpdater.php;h=04132ad5777401ef696357a14ee84a1afefa2dc3;hp=0d554544ac9db45950580d9edfda04d9e9b26006;hb=ad136143c5de92257c4ad5459d3c39186fbf800a;hpb=f3c58982eff0a5fb061db1d4519ffcdb1713213f diff --git a/includes/installer/DatabaseUpdater.php b/includes/installer/DatabaseUpdater.php index 0d554544ac..04132ad577 100644 --- a/includes/installer/DatabaseUpdater.php +++ b/includes/installer/DatabaseUpdater.php @@ -150,7 +150,7 @@ abstract class DatabaseUpdater { * LoadExtensionSchemaUpdates hook. */ private function loadExtensions() { - if ( !defined( 'MEDIAWIKI_INSTALL' ) ) { + if ( !defined( 'MEDIAWIKI_INSTALL' ) || defined( 'MW_EXTENSIONS_LOADED' ) ) { return; // already loaded } $vars = Installer::getExistingLocalSettings(); @@ -162,7 +162,7 @@ abstract class DatabaseUpdater { // This will automatically add "AutoloadClasses" to $wgAutoloadClasses $data = $registry->readFromQueue( $queue ); - $hooks = [ 'wgHooks' => [ 'LoadExtensionSchemaUpdates' => [] ] ]; + $hooks = []; if ( isset( $data['globals']['wgHooks']['LoadExtensionSchemaUpdates'] ) ) { $hooks = $data['globals']['wgHooks']['LoadExtensionSchemaUpdates']; } @@ -1263,4 +1263,23 @@ abstract class DatabaseUpdater { $this->output( "done.\n" ); } + /** + * Populate ar_rev_id, then make it not nullable + * @since 1.31 + */ + protected function populateArchiveRevId() { + $info = $this->db->fieldInfo( 'archive', 'ar_rev_id', __METHOD__ ); + if ( !$info ) { + throw new MWException( 'Missing ar_rev_id field of archive table. Should not happen.' ); + } + if ( $info->isNullable() ) { + $this->output( "Populating ar_rev_id.\n" ); + $task = $this->maintenance->runChild( 'PopulateArchiveRevId', 'populateArchiveRevId.php' ); + if ( $task->execute() ) { + $this->applyPatch( 'patch-ar_rev_id-not-null.sql', false, + 'Making ar_rev_id not nullable' ); + } + } + } + }