Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 5 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 1 |
SchemaHooks | |
0.00% |
0 / 5 |
|
0.00% |
0 / 1 |
6 | |
0.00% |
0 / 1 |
onLoadExtensionSchemaUpdates | |
0.00% |
0 / 5 |
|
0.00% |
0 / 1 |
6 |
1 | <?php |
2 | |
3 | namespace GeoData; |
4 | |
5 | use DatabaseUpdater; |
6 | use MediaWiki\Installer\Hook\LoadExtensionSchemaUpdatesHook; |
7 | |
8 | /** |
9 | * Schema hook handlers |
10 | */ |
11 | class SchemaHooks implements LoadExtensionSchemaUpdatesHook { |
12 | |
13 | /** |
14 | * LoadExtensionSchemaUpdates hook handler |
15 | * @see https://www.mediawiki.org/wiki/Manual:Hooks/LoadExtensionSchemaUpdates |
16 | * |
17 | * @param DatabaseUpdater $updater |
18 | */ |
19 | public function onLoadExtensionSchemaUpdates( $updater ) { |
20 | $base = __DIR__ . '/../sql'; |
21 | $dbType = $updater->getDB()->getType(); |
22 | $updater->addExtensionTable( 'geo_tags', "$base/$dbType/tables-generated.sql" ); |
23 | if ( $dbType !== 'postgres' ) { |
24 | $updater->addExtensionField( 'geo_tags', 'gt_lon_int', "$base/patch-geo_tags-add-lat_int-lon_int.sql" ); |
25 | } |
26 | } |
27 | |
28 | } |