Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 10 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 1 |
DatabaseHooks | |
0.00% |
0 / 10 |
|
0.00% |
0 / 1 |
6 | |
0.00% |
0 / 1 |
onLoadExtensionSchemaUpdates | |
0.00% |
0 / 10 |
|
0.00% |
0 / 1 |
6 |
1 | <?php |
2 | |
3 | namespace MediaWiki\Wikispeech\Hooks; |
4 | |
5 | /** |
6 | * @file |
7 | * @ingroup Extensions |
8 | * @license GPL-2.0-or-later |
9 | */ |
10 | |
11 | use DatabaseUpdater; |
12 | use MediaWiki\Installer\Hook\LoadExtensionSchemaUpdatesHook; |
13 | |
14 | /** |
15 | * @since 0.1.8 |
16 | */ |
17 | class DatabaseHooks |
18 | implements LoadExtensionSchemaUpdatesHook { |
19 | /** |
20 | * Creates database tables. |
21 | * |
22 | * @param DatabaseUpdater $updater |
23 | * @since 0.1.8 |
24 | */ |
25 | public function onLoadExtensionSchemaUpdates( $updater ) { |
26 | $type = $updater->getDB()->getType(); |
27 | $path = dirname( __DIR__ ) . '/../sql'; |
28 | $updater->addExtensionTable( |
29 | 'wikispeech_utterance', |
30 | "$path/$type/tables-generated.sql" |
31 | ); |
32 | if ( $type === 'postgres' ) { |
33 | $updater->modifyExtensionField( |
34 | 'wikispeech_utterance', 'wsu_date_stored', "$path/$type/patch-wikispeech_utterance-wsu_date_stored.sql" |
35 | ); |
36 | } |
37 | } |
38 | } |