X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Finstaller%2FDatabaseUpdater.php;h=7a1aba636cbcba661013c841a0af4b40ddb3eb95;hb=b7d1782e1055cd04338293d1c5ce0f09ffadbff4;hp=0d554544ac9db45950580d9edfda04d9e9b26006;hpb=a4a25aeb268276eee0719f9761cad6cce3938989;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/installer/DatabaseUpdater.php b/includes/installer/DatabaseUpdater.php index 0d554544ac..7a1aba636c 100644 --- a/includes/installer/DatabaseUpdater.php +++ b/includes/installer/DatabaseUpdater.php @@ -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' ); + } + } + } + }