Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 8
0.00% covered (danger)
0.00%
0 / 1
CRAP
0.00% covered (danger)
0.00%
0 / 1
CognateSchemaHooks
0.00% covered (danger)
0.00%
0 / 8
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 / 8
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2
3namespace Cognate;
4
5use MediaWiki\Installer\DatabaseUpdater;
6use MediaWiki\Installer\Hook\LoadExtensionSchemaUpdatesHook;
7
8/**
9 * @license GPL-2.0-or-later
10 */
11class CognateSchemaHooks implements LoadExtensionSchemaUpdatesHook {
12
13    /**
14     * Run database updates
15     *
16     * @param DatabaseUpdater $updater
17     */
18    public function onLoadExtensionSchemaUpdates( $updater ) {
19        $dbType = $updater->getDB()->getType();
20
21        $updater->addExtensionUpdateOnVirtualDomain( [
22            CognateServices::VIRTUAL_DOMAIN,
23            'addTable',
24            'cognate_pages',
25            __DIR__ . '/../sql/' . $dbType . '/tables-generated.sql',
26            true
27        ] );
28    }
29}