Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 24 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 1 |
SchemaHooks | |
0.00% |
0 / 24 |
|
0.00% |
0 / 1 |
6 | |
0.00% |
0 / 1 |
onLoadExtensionSchemaUpdates | |
0.00% |
0 / 24 |
|
0.00% |
0 / 1 |
6 |
1 | <?php |
2 | |
3 | namespace Flow; |
4 | |
5 | use Flow\Maintenance\FlowCreateTemplates; |
6 | use Flow\Maintenance\FlowFixLinks; |
7 | use Flow\Maintenance\FlowFixLog; |
8 | use Flow\Maintenance\FlowPopulateLinksTables; |
9 | use Flow\Maintenance\FlowPopulateRefId; |
10 | use Flow\Maintenance\FlowSetUserIp; |
11 | use Flow\Maintenance\FlowUpdateBetaFeaturePreference; |
12 | use Flow\Maintenance\FlowUpdateRecentChanges; |
13 | use Flow\Maintenance\FlowUpdateRevisionTypeId; |
14 | use Flow\Maintenance\FlowUpdateUserWiki; |
15 | use Flow\Maintenance\FlowUpdateWorkflowPageId; |
16 | use MediaWiki\Installer\DatabaseUpdater; |
17 | use MediaWiki\Installer\Hook\LoadExtensionSchemaUpdatesHook; |
18 | |
19 | class SchemaHooks implements LoadExtensionSchemaUpdatesHook { |
20 | |
21 | /** |
22 | * Hook: LoadExtensionSchemaUpdates |
23 | * |
24 | * @param DatabaseUpdater $updater |
25 | */ |
26 | public function onLoadExtensionSchemaUpdates( $updater ) { |
27 | $dir = dirname( __DIR__ ) . '/sql'; |
28 | $dbType = $updater->getDB()->getType(); |
29 | $updater->addExtensionTable( 'flow_revision', "$dir/$dbType/tables-generated.sql" ); |
30 | |
31 | if ( $dbType === 'mysql' ) { |
32 | // 1.35 (backported to 1.34) |
33 | $updater->modifyExtensionField( 'flow_wiki_ref', 'ref_src_wiki', |
34 | "$dir/$dbType/patch-increase-varchar-flow_wiki_ref-ref_src_wiki.sql" ); |
35 | $updater->modifyExtensionField( 'flow_ext_ref', 'ref_src_wiki', |
36 | "$dir/$dbType/patch-increase-varchar-flow_ext_ref-ref_src_wiki.sql" ); |
37 | |
38 | // 1.39 |
39 | $updater->modifyExtensionField( |
40 | 'flow_revision', |
41 | 'rev_mod_timestamp', |
42 | "$dir/$dbType/patch-flow_revision-rev_mod_timestamp.sql" |
43 | ); |
44 | } |
45 | |
46 | $updater->addPostDatabaseUpdateMaintenance( FlowUpdateRecentChanges::class ); |
47 | |
48 | $updater->addPostDatabaseUpdateMaintenance( FlowSetUserIp::class ); |
49 | |
50 | $updater->addPostDatabaseUpdateMaintenance( FlowUpdateUserWiki::class ); |
51 | |
52 | $updater->addPostDatabaseUpdateMaintenance( FlowUpdateRevisionTypeId::class ); |
53 | |
54 | $updater->addPostDatabaseUpdateMaintenance( FlowPopulateLinksTables::class ); |
55 | |
56 | $updater->addPostDatabaseUpdateMaintenance( FlowFixLog::class ); |
57 | |
58 | $updater->addPostDatabaseUpdateMaintenance( FlowUpdateWorkflowPageId::class ); |
59 | |
60 | $updater->addPostDatabaseUpdateMaintenance( FlowCreateTemplates::class ); |
61 | |
62 | $updater->addPostDatabaseUpdateMaintenance( FlowFixLinks::class ); |
63 | |
64 | $updater->addPostDatabaseUpdateMaintenance( FlowUpdateBetaFeaturePreference::class ); |
65 | |
66 | $updater->addPostDatabaseUpdateMaintenance( FlowPopulateRefId::class ); |
67 | } |
68 | } |