Previous Thread
Next Thread
Print Thread
Hop To
Joined: Jun 2006
Posts: 215
enthusiast
enthusiast
Joined: Jun 2006
Posts: 215
In domergeuser2.php , the merge user script only update these tables :
ubbt_USER_PROFILE
ubbt_TOPICS
ubbt_POSTS
ubbt_FILES
ubbt_POLL_DATA
ubbt_PRIVATE_MESSAGE_TOPICS
ubbt_PRIVATE_MESSAGE_POSTS
ubbt_PRIVATE_MESSAGE_USERS
ubbt_SHOUT_BOX

delete :
ubbt_USERS
ubbt_USER_PROFILE
ubbt_USER_DATA
ubbt_USER_GROUPS
ubbt_FORUM_LAST_VISIT


But there are other tables that contains USER_ID that is not cleaned / modified , such as :
ubbt_BANNED_USERS (delete ?)
ubbt_CALENDAR_EVENTS (delete ?)
ubbt_MODERATORS (delete ?)
ubbt_RATINGS where RATING_TYPE = 'u' (delete ?)
ubbt_WATCH_LISTS where WATCH_TYPE = 'u' (delete ?)
... (maybe there're still others missed here)

Is it ok to leave these 'zombie' data ?
When migrating to 8.0 , will there be a 'clean-up' script that scans the whole integrity of the db ?


English is not my native language. I try my best to express my thought precisely. I hope you understand what I mean. If any misunderstanding results from culture gaps, I apologize first.
Joined: Dec 2003
Posts: 6,562
Likes: 78
Joined: Dec 2003
Posts: 6,562
Likes: 78
Good question.
We currently have issues over the different versions with orphaned data/files.
It would be nice to have something to clean them all up.
Including file attachments and gallery items.


Blue Man Group
There is no such thing as stupid questions. Just stupid answers
Joined: Jun 2006
Posts: 215
enthusiast
enthusiast
Joined: Jun 2006
Posts: 215
Are these codes sufficient ? (groovy codes , but easy to understand)

Code

db.execute """
  delete from ubbt_BANNED_USERS
  where USER_ID = $fromUser
"""

db.execute """
  delete from ubbt_CALENDAR_EVENTS
  where USER_ID = $fromUser
"""

db.execute """
  delete from ubbt_RATINGS
  where RATING_RATER = $fromUser or ( RATING_TYPE = 'u' and RATING_TARGET = $fromUser)
"""

db.execute """
  delete from ubbt_CALENDAR_EVENTS
  where USER_ID = $fromUser
"""

db.execute """
  delete from ubbt_WATCH_LISTS
  where USER_ID = $fromUser or ( WATCH_TYPE = 'u' and WATCH_ID = $fromUser )
"""



English is not my native language. I try my best to express my thought precisely. I hope you understand what I mean. If any misunderstanding results from culture gaps, I apologize first.
Joined: Apr 2007
Posts: 3,940
Likes: 1
SD Offline
Former Developer
Former Developer
Joined: Apr 2007
Posts: 3,940
Likes: 1
well, technically that works, but if you are merging a banned user into a non-banned one you might OR the ban state?

same idea for the other ones...

so YES, delete removes all traces of former, but doesn't truly then MERGE

you might think of UPDATE queries and REPLACE INTO queries if you truly want to merge..

in the end, your queries are good for a removal of the former self though smile


Link Copied to Clipboard
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Recent Topics
Bots
by Outdoorking - 04/13/2024 5:08 PM
Can you add html to language files?
by Baldeagle - 04/07/2024 2:41 PM
Do I need to rebuild my database?
by Baldeagle - 04/07/2024 2:58 AM
This is not a bug, but a suggestion
by Baldeagle - 04/05/2024 11:25 PM
spam issues
by ECNet - 03/19/2024 11:45 PM
Who's Online Now
1 members (1 invisible), 875 guests, and 141 robots.
Key: Admin, Global Mod, Mod
Random Gallery Image
Latest Gallery Images
Los Angeles
Los Angeles
by isaac, August 6
3D Creations
3D Creations
by JAISP, December 30
Artistic structures
Artistic structures
by isaac, August 29
Stones
Stones
by isaac, August 19
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20230217)