Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 4
0.00% covered (danger)
0.00%
0 / 1
CRAP
0.00% covered (danger)
0.00%
0 / 1
SchemaHooks
0.00% covered (danger)
0.00%
0 / 4
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 / 4
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2namespace MediaWiki\Extension\Newsletter;
3
4use MediaWiki\Installer\DatabaseUpdater;
5use MediaWiki\Installer\Hook\LoadExtensionSchemaUpdatesHook;
6
7/**
8 * Class to add schema hooks used by Newsletter.
9 */
10class SchemaHooks implements LoadExtensionSchemaUpdatesHook {
11
12    /**
13     * Add tables to Database
14     *
15     * @param DatabaseUpdater $updater
16     */
17    public function onLoadExtensionSchemaUpdates( $updater ) {
18        $type = $updater->getDB()->getType();
19        $updater->addExtensionTable( 'nl_newsletters', __DIR__ . '/../sql/' . $type . '/tables-generated.sql' );
20        $updater->modifyExtensionTable( 'nl_newsletters',
21            __DIR__ . '/../sql/' . $type . '/patch-drop-unique-indices.sql' );
22    }
23}