3 namespace MediaWiki\Tests\Revision
;
5 use Wikimedia\Rdbms\IMaintainableDatabase
;
6 use MediaWiki\DB\PatchFileLocation
;
9 * Trait providing schema overrides that allow tests to run against the pre-MCR database schema.
11 trait PreMcrSchemaOverride
{
13 use PatchFileLocation
;
14 use McrSchemaDetection
;
19 protected function getMcrMigrationStage() {
26 protected function getMcrTablesToReset() {
33 protected function getSchemaOverrides( IMaintainableDatabase
$db ) {
41 if ( $this->hasMcrTables( $db ) ) {
42 $overrides['drop'] = [ 'slots', 'content', 'slot_roles', 'content_models', ];
43 $overrides['scripts'][] = $this->getSqlPatchPath( $db, '/drop-mcr-tables', __DIR__
);
46 if ( !$this->hasPreMcrFields( $db ) ) {
47 $overrides['alter'][] = 'revision';
48 $overrides['scripts'][] = $this->getSqlPatchPath( $db, '/create-pre-mcr-fields', __DIR__
);