Re: script cleanup

"Heath S. Hendrickson" <[email protected]>
Newsgroups gmane.comp.horde.ansel
Message-ID <[email protected]>
Ben Chavet wrote:

>A while ago, I committed a touch_galleries.php script to ansel.  Turns out, it
>"touched" the images, too & gave them all of the gallery attributes.  This adds
>a lot of unnecessary bloat to the database.  This SQL command:
>
>delete from horde_datatree_attributes where datatree_id in (select datatree_id
>from horde_datatree_attributes where attribute_name='type' and
>attribute_value='image/jpeg') and (attribute_name='thumbnail_width' or
>attribute_name='thumbnail_height' or attribute_name='image_width' or
>attribute_name='image_height' or attribute_name='default' or
>attribute_name='default-type' or attribute_name='num-images' or
>attribute_name='date-created' or attribute_name='last-modified');
>
>worked for me to clean up my horde_datatree_attributes table.  Use it at your
>own risk...
>
>--Ben
>  
>

Ben,

MySQL <4.1 doesn't allow subselect queries... you have to do it as a 
left join. 

What I found interesting was that I only had a handful of datatree_id's 
that had type=image/jpeg.  Is that attribute a recent addition to 
Ansel?  Should it be set for all images in the datatree?

h

h
-- 
ansel mailing list - Join the hunt: http://horde.org/bounties/#ansel
Frequently Asked Questions: http://horde.org/faq/
To unsubscribe, mail: [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.