MediaWiki REL1_33
McrWriteBothSchemaOverride.php
Go to the documentation of this file.
1<?php
3
6
11trait McrWriteBothSchemaOverride {
12
13 use PatchFileLocation;
14 use McrSchemaDetection;
15
19 protected function getMcrMigrationStage() {
21 }
22
26 protected function getMcrTablesToReset() {
27 return [ 'content', 'content_models', 'slots', 'slot_roles' ];
28 }
29
33 protected function getSchemaOverrides( IMaintainableDatabase $db ) {
34 $overrides = [
35 'scripts' => [],
36 'drop' => [],
37 'create' => [],
38 'alter' => [],
39 ];
40
41 if ( !$this->hasMcrTables( $db ) ) {
42 $overrides['create'] = [ 'slots', 'content', 'slot_roles', 'content_models', ];
43 $overrides['scripts'][] = $this->getSqlPatchPath( $db, 'patch-slot_roles' );
44 $overrides['scripts'][] = $this->getSqlPatchPath( $db, 'patch-content_models' );
45 $overrides['scripts'][] = $this->getSqlPatchPath( $db, 'patch-content' );
46 $overrides['scripts'][] = $this->getSqlPatchPath( $db, 'patch-slots' );
47 }
48
49 if ( !$this->hasPreMcrFields( $db ) ) {
50 $overrides['alter'][] = 'revision';
51 $overrides['scripts'][] = $this->getSqlPatchPath( $db, 'create-pre-mcr-fields', __DIR__ );
52 }
53
54 return $overrides;
55 }
56
57}
and that you know you can do these things To protect your we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights These restrictions translate to certain responsibilities for you if you distribute copies of the or if you modify it For if you distribute copies of such a whether gratis or for a you must give the recipients all the rights that you have You must make sure that receive or can get the source code And you must show them these terms so they know their rights We protect your rights with two and(2) offer you this license which gives you legal permission to copy
const SCHEMA_COMPAT_WRITE_BOTH
Definition Defines.php:297
const SCHEMA_COMPAT_READ_OLD
Definition Defines.php:294
Advanced database interface for IDatabase handles that include maintenance methods.
getSchemaOverrides(IMaintainableDatabase $db)