[ansel] script cleanup

Heath S. Hendrickson heath at outerspaceconsultants.com
Tue Jun 1 18:24:55 PDT 2004


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


More information about the ansel mailing list