Created
October 4, 2018 03:08
-
-
Save datio/56b741e68907316c7ebce35d4154eb5b to your computer and use it in GitHub Desktop.
XenForo 2 make all users' primary group the registered group
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
UPDATE xf_user | |
SET secondary_group_ids = CONCAT(user_group_id, ',', secondary_group_ids) | |
WHERE LENGTH(secondary_group_ids) > 0 | |
AND user_group_id <> 2; | |
UPDATE xf_user | |
SET secondary_group_ids = user_group_id | |
WHERE secondary_group_ids = '' | |
AND user_group_id <> 2; | |
UPDATE xf_user | |
SET user_group_id = 2; | |
UPDATE xf_user_group_relation | |
SET is_primary = 0 | |
WHERE user_group_id <> 2; | |
INSERT IGNORE xf_user_group_relation (user_id, user_group_id, is_primary) | |
SELECT user_id, 2, 1 | |
FROM xf_user; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment