[vhffs-dev] [1323] delete duplicate values in vhffs_ml_subscribers

[ Thread Index | Date Index | More vhffs.org/vhffs-dev Archives ]


Revision: 1323
Author:   gradator
Date:     2009-01-11 18:48:36 +0100 (Sun, 11 Jan 2009)

Log Message:
-----------
delete duplicate values in vhffs_ml_subscribers

Modified Paths:
--------------
    trunk/vhffs-compat/4.1.sql


Modified: trunk/vhffs-compat/4.1.sql
===================================================================
--- trunk/vhffs-compat/4.1.sql	2009-01-11 17:04:48 UTC (rev 1322)
+++ trunk/vhffs-compat/4.1.sql	2009-01-11 17:48:36 UTC (rev 1323)
@@ -54,6 +54,11 @@
 
 ALTER TABLE vhffs_object_tag ADD CONSTRAINT fk_vhffs_object_tag_vhffs_users FOREIGN KEY ( updater_id ) REFERENCES vhffs_users( uid ) ON DELETE SET NULL;
 
-
 -- and not necessary but useful
 CREATE INDEX idx_vhffs_tag_category_visibility ON vhffs_tag_category(visibility);
+
+
+-- delete duplicate values in vhffs_ml_subscribers (inserted members where not lowered)
+DELETE FROM vhffs_ml_subscribers WHERE EXISTS ( SELECT 'x' FROM vhffs_ml_subscribers m WHERE LOWER(m.member) = LOWER(vhffs_ml_subscribers.member) AND m.ml_id = vhffs_ml_subscribers.ml_id AND m.sub_id < vhffs_ml_subscribers.sub_id );
+UPDATE vhffs_ml_subscribers set member=LOWER(member);
+


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/