2019-11-10, 05:35 AM
So long story short
my UID's are all mixed up
and Id like to know if mybb has a feature or a plugin
where I can re account UID's
as I have 60 members but they are at UID 200
(2019-11-10, 05:49 AM)Ben Cousins Wrote: [ -> ]Wouldn't advise it.
(2019-11-10, 07:05 PM)Matt Wrote: [ -> ]You'll enter into a world of pain trying to always have the IDs sequential. It's an arbitrary auto-incrementing number generated by the database for every new row added to a table, which is used to identify it and link it to other data. The same thing will happen every time you delete a post or thread, and the IDs are used all over the place, so you'll likely end up with mismatched data if you try and reset them (i.e. if you had posts by UID 10, and reset the UIDs to start at 5, then when it gets to create user ID 10 again, they would have someone else's posts attributed to them). You'll only screw up your data trying to do this.
(2019-11-10, 07:05 PM)Matt Wrote: [ -> ]You'll enter into a world of pain trying to always have the IDs sequential. It's an arbitrary auto-incrementing number generated by the database for every new row added to a table, which is used to identify it and link it to other data. The same thing will happen every time you delete a post or thread, and the IDs are used all over the place, so you'll likely end up with mismatched data if you try and reset them (i.e. if you had posts by UID 10, and reset the UIDs to start at 5, then when it gets to create user ID 10 again, they would have someone else's posts attributed to them). You'll only screw up your data trying to do this.
SELECT * FROM `DBPREFIX_users` ORDER BY `uid` ASC;
SET @count = 40000000;
UPDATE `DBPREFIX_users` SET `uid` = @count:= @count + 1;
SET @count = 0;
UPDATE `DBPREFIX_users` SET `uid` = @count:= @count + 1;
ALTER TABLE `DBPREFIX_users` AUTO_INCREMENT = 1;
ALTER TABLE `DBPREFIX_users` AUTO_INCREMENT = 1;