Author |
Topic  |
|
bitwise2000
Starting Member
38 Posts |
Posted - 16 October 2006 : 18:02:18
|
I'd like to purge all subscriptions older than a particular date for members who are not mods or admins. Anyone have an SQL statement for that? Otherwise, I'll write one and post it. THANKS! |
|
Shaggy
Support Moderator
    
Ireland
6780 Posts |
Posted - 17 October 2006 : 04:17:14
|
You will not be able to do it my date as the date is not stored in the SUBSCRIPTIONS table.
|
Search is your friend “I was having a mildly paranoid day, mostly due to the fact that the mad priest lady from over the river had taken to nailing weasels to my front door again.” |
 |
|
bitwise2000
Starting Member
38 Posts |
Posted - 18 October 2006 : 23:22:36
|
Yes, it can be done by date. It just takes a join or subquery on the topics table. Here's an example that deletes all subscriptions to topics which have not had a post since Jan 1, 2006.
DELETE FROM Forum_Subscriptions WHERE Subscription_ID IN (SELECT S.Subscription_ID FROM Forum_Subscriptions S LEFT JOIN Forum_Topics T ON S.Topic_ID=T.Topic_ID WHERE T.T_Last_Post<20060101000000 AND S.Member_ID NOT IN (Select M.Member_ID from Forum_Members M where M.M_Level>1))
I'll post the rest of my subscription cleanup queries next week. Maybe someone can use... |
 |
|
Shaggy
Support Moderator
    
Ireland
6780 Posts |
Posted - 19 October 2006 : 03:57:19
|
Ah, OK - misunderstood what you were trying to do 
|
Search is your friend “I was having a mildly paranoid day, mostly due to the fact that the mad priest lady from over the river had taken to nailing weasels to my front door again.” |
 |
|
HuwR
Forum Admin
    
United Kingdom
20595 Posts |
Posted - 19 October 2006 : 04:56:58
|
I think I read it like you did Shaggy, I also though he wan't to delete subscriptions older than a particular date rather than subscriptions to topics that were older than a particular date 
Please feel free to post your finished query bitwise2000 |
 |
|
Shaggy
Support Moderator
    
Ireland
6780 Posts |
Posted - 19 October 2006 : 05:05:34
|
Ay, that's what I thought was being asked.
|
Search is your friend “I was having a mildly paranoid day, mostly due to the fact that the mad priest lady from over the river had taken to nailing weasels to my front door again.” |
 |
|
bitwise2000
Starting Member
38 Posts |
Posted - 23 October 2006 : 18:09:06
|
I did indeed state poorly what I was trying to do. Thanks |
 |
|
bobby131313
Senior Member
   
USA
1163 Posts |
Posted - 23 October 2006 : 20:01:13
|
This would be a good to have. I hate that the "all subscriptions" page gets so large and cluttered. Probably doesn't really hurt anything, but I'm anal. 
I found a new subscription page that's awesome, it has check boxes so that you can delete many at once. It has a date for each topic, but its the topic creation date, not the last post date, which would be awesome. 
|
Switch the order of your title tags |
 |
|
|
Topic  |
|