Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | n/a |
0 / 0 |
n/a |
0 / 0 |
CRAP | n/a |
0 / 0 |
|||
SchemaChangesHandler | n/a |
0 / 0 |
n/a |
0 / 0 |
1 | n/a |
0 / 0 |
|||
onLoadExtensionSchemaUpdates | n/a |
0 / 0 |
n/a |
0 / 0 |
1 |
1 | <?php |
2 | |
3 | namespace MediaWiki\Extension\MediaModeration\Hooks\Handlers; |
4 | |
5 | use MediaWiki\Extension\MediaModeration\Maintenance\ImportExistingFilesToScanTable; |
6 | use MediaWiki\Installer\Hook\LoadExtensionSchemaUpdatesHook; |
7 | |
8 | class SchemaChangesHandler implements LoadExtensionSchemaUpdatesHook { |
9 | /** |
10 | * @inheritDoc |
11 | * @codeCoverageIgnore Tested by updating or installing MediaWiki. |
12 | */ |
13 | public function onLoadExtensionSchemaUpdates( $updater ) { |
14 | $base = __DIR__ . '/../../../schema'; |
15 | $maintenanceDb = $updater->getDB(); |
16 | $dbType = $maintenanceDb->getType(); |
17 | $updater->addExtensionUpdateOnVirtualDomain( [ |
18 | 'virtual-mediamoderation', |
19 | 'addTable', |
20 | 'mediamoderation_scan', |
21 | "$base/$dbType/tables-generated.sql", |
22 | true |
23 | ] ); |
24 | $updater->addPostDatabaseUpdateMaintenance( ImportExistingFilesToScanTable::class ); |
25 | } |
26 | } |