Previous Thread
Next Thread
Print Thread
Hop To
Clean up poll data
#214346 06/12/2008 7:40 AM
Joined: Aug 2006
Posts: 1,356
Yarp Offline OP
veteran
OP Offline
veteran
Joined: Aug 2006
Posts: 1,356
I did a check for "orphan" polls, polls that are not linked to any post, and found myself a few.

If you have MySQL >= 4.1 you might want to have a look if you can clean up a little too:

Code
SELECT POLL_BODY
FROM ubbt_POLL_DATA
WHERE POST_ID NOT
IN (
SELECT POST_ID
FROM ubbt_POSTS
)

This will show the poll questions of orphaned polls.

Code
delete from ubbt_POLL_DATA where POST_ID not in (select POST_ID from ubbt_POSTS);
delete from ubbt_POLL_OPTIONS where POLL_ID not in (select POLL_ID from ubbt_POLL_DATA);
delete from ubbt_POLL_VOTES where POLL_ID not in (select POLL_ID from ubbt_POLL_DATA);

These 3 do the actual cleanup (polls, poll options and the votes). Change the ubbt_ prefix if you happen to have another one in use.


[Linked Image from siemons.org]
Re: Clean up poll data
Yarp #214352 06/12/2008 10:23 AM
Joined: Apr 2007
Posts: 3,940
SD Offline
Former Developer
Offline
Former Developer
Joined: Apr 2007
Posts: 3,940
should be added to content rebuilder

good stuff Yarp™-UNiT

Re: Clean up poll data
SD #214370 06/12/2008 4:33 PM
Joined: Aug 2006
Posts: 1,356
Yarp Offline OP
veteran
OP Offline
veteran
Joined: Aug 2006
Posts: 1,356
Originally Posted by Sirdude
should be added to content rebuilder


and more cleanup stuff.

Time for threads requiring mysql 4.1 laugh


[Linked Image from siemons.org]
Re: Clean up poll data
Yarp #214374 06/12/2008 5:45 PM
Joined: Nov 2006
Posts: 3,090
Carpal Tunnel
Offline
Carpal Tunnel
Joined: Nov 2006
Posts: 3,090
Originally Posted by blaaskaak
Time for threads requiring mysql 4.1 laugh

Well they're already on version 5.0 and have 5.1RC as well as current work on 6.x Alpha. Now that Sun owns MySQL hopefully it remains FREE and who knows maybe the build and test phases may come sooner between builds.

http://dev.mysql.com/downloads/

.


Link Copied to Clipboard
ShoutChat Box
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Recent Topics
Disaster!!! Files became empty.. Please advise.
by Morgan - 07/27/2020 2:38 PM
Unable to Update Censor List
by BOTCuser - 07/22/2020 9:15 AM
7.7.4 error on rebuilders
by Ruben - 07/21/2020 3:06 PM
[STOCK] UBB.threads Group Image Pack
by isaac - 07/19/2020 9:03 PM
Who's Online Now
3 members (Ruben, Gizmo, 1 invisible), 73 guests, and 57 robots.
Key: Admin, Global Mod, Mod
Random Gallery Image
Latest Gallery Images
3D Creations
3D Creations
by JAISP, December 30
Artistic structures
Artistic structures
by isaac, August 29
Stones
Stones
by isaac, August 19
Amusing Terain Scenics
Amusing Terain Scenics
by isaac, August 19
Powered by UBB.threads™ PHP Forum Software 7.7.5
(Snapshot build 20200804)