to delete categories: go into settings, click category management (in the panel on the left) and click the x next to the category you want to delete.
i think deleting users must be done directly from the database at this point. if you don't want to do that, create a new role called "Deleted" (or something). Take away all the new role's privileges, and change the user to the new role.
really.., because i did what you are telling me, that is click the cross right to the category i want to delete, but then it asks me for a replacement category ?!?
All i want is to erase the category and the discussions within it.
Don t know if it is possilbe ?
okay for the users, thank you
The only way to delete a discussion is to hide it, and use the System Cleanup extension to delete all hidden discussions.
This is a bit of a hassle when you want to delete all discussions in a particular category.
bergamot is right... that is a different matter. there is no way to do it right now. it is not a matter of a single sql query. it will have to be an extension.
right now i'd suggest this: go into category managment, edit the category, and uncheck all the roles so that no one can see that category. this will accomplish the same thing.
i don't know if it could be done without stored procedures. first you'd have to find all the discussions in the category, then delete all the comments in each of those discussions from LUM_Comments. this would be an extremely tricky (and/or memory-intensive) join. then you'd have to delete the discussions from LUM_Discussions, then delete the category from LUM_Categories, then delete all matching records with that category id from LUM_CategoryBlock and LUM_CategoryRoleBlock.
if it can be done in mysql i would like to see the query. (this is not sarcasm.)
DELETE FROM LUM_Comment
INNER JOIN LUM_Discussion ON LUM_Comment.DiscussionID = LUM_Discussion.DiscussionID
WHERE LUM_Discussion.CategoryID = [id of the category you want to delete]
DELETE FROM LUM_Discussion
WHERE LUM_Discussion.CategoryID = [id of the category you want to delete]
DELETE FROM LUM_Category
WHERE LUM_Category.CategoryID = [id of the category you want to delete]
I haven't tested it (don't have a spare vanilla db laying around) but it should work. If it destroys your tables, don't blame me...
i'll stand by my "memory-intensive" comment, but i think you're right on. i was working it out on the ride home and started thinking that maybe it wasn't as complicated as i was making it in my head.
you still need to add DELETE FROM LUM_CategoryBlock
WHERE CategoryID = [id of the category you want to delete]
DELETE FROM LUM_CategoryRoleBlock
WHERE CategoryID = [id of the category you want to delete] to get all the scraps.
To maintain data integrity, they should go between my second and third queries.
As far as it being memory intensive, a join can't be much more than O(n2). I know the LUM_Comment table can get pretty big, but the LUM_Discussion table is guaranteed to have fewer records than LUM_Comment, and likely a *lot* fewer.
At any rate, that's the worst case; in reality I would guess that it would be very close to linear. I haven't spent much time looking at how MySQL executes something like this, but if it has any sort of optimization at all, it'll be fine.
Comments
i think deleting users must be done directly from the database at this point. if you don't want to do that, create a new role called "Deleted" (or something). Take away all the new role's privileges, and change the user to the new role.
right now i'd suggest this: go into category managment, edit the category, and uncheck all the roles so that no one can see that category. this will accomplish the same thing.
i don't know if it could be done without stored procedures.
first you'd have to find all the discussions in the category, then delete all the comments in each of those discussions from LUM_Comments. this would be an extremely tricky (and/or memory-intensive) join.
then you'd have to delete the discussions from LUM_Discussions, then delete the category from LUM_Categories, then delete all matching records with that category id from LUM_CategoryBlock and LUM_CategoryRoleBlock.
if it can be done in mysql i would like to see the query. (this is not sarcasm.)
DELETE FROM LUM_Comment INNER JOIN LUM_Discussion ON LUM_Comment.DiscussionID = LUM_Discussion.DiscussionID WHERE LUM_Discussion.CategoryID = [id of the category you want to delete] DELETE FROM LUM_Discussion WHERE LUM_Discussion.CategoryID = [id of the category you want to delete] DELETE FROM LUM_Category WHERE LUM_Category.CategoryID = [id of the category you want to delete]
I haven't tested it (don't have a spare vanilla db laying around) but it should work. If it destroys your tables, don't blame me...
you still need to add
DELETE FROM LUM_CategoryBlock WHERE CategoryID = [id of the category you want to delete] DELETE FROM LUM_CategoryRoleBlock WHERE CategoryID = [id of the category you want to delete]
to get all the scraps.
To maintain data integrity, they should go between my second and third queries.
As far as it being memory intensive, a join can't be much more than O(n2). I know the LUM_Comment table can get pretty big, but the LUM_Discussion table is guaranteed to have fewer records than LUM_Comment, and likely a *lot* fewer.
At any rate, that's the worst case; in reality I would guess that it would be very close to linear. I haven't spent much time looking at how MySQL executes something like this, but if it has any sort of optimization at all, it'll be fine.