: How to create new tables in mediawki 1.25+? How is the hook set up to create new database tables when an extension is registered in MediaWiki 1.25+? The manual says Possibly the Hooks
How is the hook set up to create new database tables when an extension is registered in MediaWiki 1.25+?
The manual says
Possibly the Hooks section of extensions.json should be used...
What I tried
in MyExtension/extension.json
"Hooks": {
"LoadExtensionSchemaUpdate": [
"MyExtensionHooks::mySchemaUpdate"
]
}
in MyExtension/MyExtension.hooks.php
class MyExtensionHooks {
public static function mySchemaUpdate( DatabaseUpdater $updater ) {
$updater->addExtensionTable( 'newTable',
__DIR__ . '/table.sql' );
return true;
}
}
in MyExtension/table.sql
CREATE TABLE newTable (
newTableID int not null auto_increment,
primary key (newTableID)
);
I ran ../maintenance/update.php but no newTable was created.
More posts by @Speyer207
2 Comments
Sorted by latest first Latest Oldest Best
Add this to your domain URL /mw-config/ and the update page will appear
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.