$this->output( "done.\n" );
}
}
+
+ /**
+ * Populates the MCR content tables
+ * @since 1.32
+ */
+ protected function populateContentTables() {
+ global $wgMultiContentRevisionSchemaMigrationStage;
+ if ( ( $wgMultiContentRevisionSchemaMigrationStage & SCHEMA_COMPAT_WRITE_NEW ) &&
+ !$this->updateRowExists( 'PopulateContentTables' )
+ ) {
+ $this->output(
+ "Migrating revision data to the MCR 'slot' and 'content' tables, printing progress markers.\n" .
+ "For large databases, you may want to hit Ctrl-C and do this manually with\n" .
+ "maintenance/populateContentTables.php.\n"
+ );
+ $task = $this->maintenance->runChild(
+ PopulateContentTables::class, 'populateContentTables.php'
+ );
+ $ok = $task->execute();
+ $this->output( $ok ? "done.\n" : "errors were encountered.\n" );
+ if ( $ok ) {
+ $this->insertUpdateRow( 'PopulateContentTables' );
+ }
+ }
+ }
}
[ 'runMaintenance', DeduplicateArchiveRevId::class, 'maintenance/deduplicateArchiveRevId.php' ],
[ 'addField', 'change_tag', 'ct_tag_id', 'patch-change_tag-tag_id.sql' ],
[ 'addIndex', 'archive', 'ar_revid_uniq', 'patch-archive-ar_rev_id-unique.sql' ],
+ [ 'populateContentTables' ],
];
}
[ 'runMaintenance', DeduplicateArchiveRevId::class, 'maintenance/deduplicateArchiveRevId.php' ],
[ 'addField', 'change_tag', 'ct_tag_id', 'patch-change_tag-tag_id.sql' ],
[ 'addIndex', 'archive', 'ar_revid_uniq', 'patch-archive-ar_rev_id-unique.sql' ],
+ [ 'populateContentTables' ],
];
}
[ 'runMaintenance', DeduplicateArchiveRevId::class, 'maintenance/deduplicateArchiveRevId.php' ],
[ 'addField', 'change_tag', 'ct_tag_id', 'patch-change_tag-tag_id.sql' ],
[ 'addIndex', 'archive', 'ar_revid_uniq', 'patch-archive-ar_rev_id-unique.sql' ],
+ [ 'populateContentTables' ],
// KEEP THIS AT THE BOTTOM!!
[ 'doRebuildDuplicateFunction' ],
],
[ 'addPgIndex', 'archive', 'ar_revid_uniq', '(ar_rev_id)', 'unique' ],
[ 'dropPgIndex', 'archive', 'ar_revid' ], // Probably doesn't exist, but do it anyway.
+ [ 'populateContentTables' ],
];
}
[ 'runMaintenance', DeduplicateArchiveRevId::class, 'maintenance/deduplicateArchiveRevId.php' ],
[ 'addField', 'change_tag', 'ct_tag_id', 'patch-change_tag-tag_id.sql' ],
[ 'addIndex', 'archive', 'ar_revid_uniq', 'patch-archive-ar_rev_id-unique.sql' ],
+ [ 'populateContentTables' ],
];
}
$elapsed = microtime( true ) - $t0;
$this->writeln( "Done. Processed $this->totalCount rows in $elapsed seconds" );
+ return true;
}
/**