Semantic MediaWiki and related extensions
|
Demonstrates how to add primary keys ([#3559][issue-3559]) to Semantic MediaWiki table definitions.
```php use Hooks;
Hooks::register( 'SMW::SQLStore::Installer::BeforeCreateTablesComplete', function( array $tables, $messageReporter ) {
// #3559 // Incomplete list to only showcase how to modify the table definition $primaryKeys = [ 'smw_di_blob' => 'p_id,s_id,o_hash', 'smw_di_bool' => 'p_id,s_id,o_value', 'smw_di_uri' => 'p_id,s_id,o_serialized', 'smw_di_coords' => 'p_id,s_id,o_serialized', 'smw_di_wikipage' => 'p_id,s_id,o_id', 'smw_di_number' => 'p_id,s_id,o_serialized', // smw_fpt ... 'smw_prop_stats' => 'p_id', 'smw_query_links' => 's_id,o_id' ]; /** *