Nbdd0121 has uploaded a new change for review. https://gerrit.wikimedia.org/r/295081
Change subject: Add LoadExtensionSchemaUpdates hooks so the table will be created automatically when running `php maintenance/update.php --doshared` ...................................................................... Add LoadExtensionSchemaUpdates hooks so the table will be created automatically when running `php maintenance/update.php --doshared` Change-Id: I8003cc83721f9212ff8889e1f011dc7c1d1a1a70 --- M GlobalUserrightsHooks.php M extension.json M global_user_groups.sql 3 files changed, 14 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/GlobalUserrights refs/changes/81/295081/1 diff --git a/GlobalUserrightsHooks.php b/GlobalUserrightsHooks.php index a28d635..4236341 100644 --- a/GlobalUserrightsHooks.php +++ b/GlobalUserrightsHooks.php @@ -104,4 +104,13 @@ } return true; } -} \ No newline at end of file + + /** + * Create SQL automatically when running update.php so sql does not have to be + * applied manually + */ + public static function onLoadExtensionSchemaUpdates( $updater ) { + $updater->addExtensionTable('global_user_groups', __DIR__ . '/global_user_groups.sql'); + return true; + } +} diff --git a/extension.json b/extension.json index b56de1e..2abb026 100644 --- a/extension.json +++ b/extension.json @@ -24,6 +24,9 @@ "GlobalUserrightsHooks": "GlobalUserrightsHooks.php" }, "Hooks": { + "LoadExtensionSchemaUpdates": [ + "GlobalUserrightsHooks::onLoadExtensionSchemaUpdates" + ], "UserEffectiveGroups": [ "GlobalUserrightsHooks::onUserEffectiveGroups" ], diff --git a/global_user_groups.sql b/global_user_groups.sql index 5cdc05d..7b3525f 100644 --- a/global_user_groups.sql +++ b/global_user_groups.sql @@ -1,8 +1,7 @@ -- Additional table for the GlobalUserrights extension -- To be added to $wgSharedDB --- replace /*$wgSharedPrefix*/ with $wgSharedPrefix -CREATE TABLE /*$wgSharedPrefix*/global_user_groups ( +CREATE TABLE /*_*/global_user_groups ( -- Key to user_id gug_user int unsigned NOT NULL default '0', -- Group name -- To view, visit https://gerrit.wikimedia.org/r/295081 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8003cc83721f9212ff8889e1f011dc7c1d1a1a70 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/GlobalUserrights Gerrit-Branch: master Gerrit-Owner: Nbdd0121 <nbdd0...@hotmail.com> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits