Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 44
0.00% covered (danger)
0.00%
0 / 1
CRAP
0.00% covered (danger)
0.00%
0 / 1
SchemaChangesHandler
0.00% covered (danger)
0.00%
0 / 44
0.00% covered (danger)
0.00%
0 / 1
2
0.00% covered (danger)
0.00%
0 / 1
 onLoadExtensionSchemaUpdates
0.00% covered (danger)
0.00%
0 / 44
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2
3declare( strict_types=1 );
4
5namespace MediaWiki\Extension\CampaignEvents\Hooks\Handlers;
6
7use MediaWiki\Extension\CampaignEvents\Utils;
8use MediaWiki\Installer\DatabaseUpdater;
9use MediaWiki\Installer\Hook\LoadExtensionSchemaUpdatesHook;
10
11class SchemaChangesHandler implements LoadExtensionSchemaUpdatesHook {
12    /**
13     * @param DatabaseUpdater $updater
14     */
15    public function onLoadExtensionSchemaUpdates( $updater ) {
16        $dbType = $updater->getDB()->getType();
17        $dir = __DIR__ . "/../../../db_patches";
18
19        $updater->addExtensionUpdateOnVirtualDomain( [
20            Utils::VIRTUAL_DB_DOMAIN,
21            'addTable',
22            'ce_event_address',
23            "$dir/$dbType/tables-generated.sql",
24            true
25        ] );
26
27        $updater->addExtensionUpdateOnVirtualDomain( [
28            Utils::VIRTUAL_DB_DOMAIN,
29            'addTable',
30            'ce_invitation_lists',
31            "$dir/$dbType/patch-add-ce_invitation_lists.sql",
32            true
33        ] );
34
35        $updater->addExtensionUpdateOnVirtualDomain( [
36            Utils::VIRTUAL_DB_DOMAIN,
37            'addTable',
38            'ce_worklist_articles',
39            "$dir/$dbType/patch-add-ce_worklist_articles.sql",
40            true
41        ] );
42
43        $updater->addExtensionUpdateOnVirtualDomain( [
44            Utils::VIRTUAL_DB_DOMAIN,
45            'addTable',
46            'ce_invitation_list_users',
47            "$dir/$dbType/patch-add-ce_invitation_list_users.sql",
48            true
49        ] );
50
51        $updater->addExtensionUpdateOnVirtualDomain( [
52            Utils::VIRTUAL_DB_DOMAIN,
53            'addTable',
54            'ce_event_wikis',
55            "$dir/$dbType/patch-add-ce_event_wikis.sql",
56            true
57        ] );
58
59        $updater->addExtensionUpdateOnVirtualDomain( [
60            Utils::VIRTUAL_DB_DOMAIN,
61            'addTable',
62            'ce_event_topics',
63            "$dir/$dbType/patch-add-ce_event_topics.sql",
64            true
65        ] );
66    }
67}