Adds notify_all flag to groups.
authorStéphane Jacob <sj@m4x.org>
Wed, 2 Nov 2011 12:14:22 +0000 (13:14 +0100)
committerStéphane Jacob <sj@m4x.org>
Wed, 2 Nov 2011 12:14:22 +0000 (13:14 +0100)
Signed-off-by: Stéphane Jacob <sj@m4x.org>
classes/group.php
upgrade/1.1.4/11_groups.sql

index d17562c..72ce770 100644 (file)
@@ -117,6 +117,7 @@ class Group
         $res = XDB::query('SELECT  a.*, d.nom AS domnom,
                                    FIND_IN_SET(\'wiki_desc\', a.flags) AS wiki_desc,
                                    FIND_IN_SET(\'notif_unsub\', a.flags) AS notif_unsub,
+                                   FIND_IN_SET(\'notify_all\', a.flags) AS notify_all,
                                    (nls.id IS NOT NULL) AS has_nl, ad.text AS address,
                                    p.display_tel AS phone, f.display_tel AS fax
                              FROM  groups AS a
index 6910c8e..0b8f906 100644 (file)
@@ -1,3 +1,5 @@
 ALTER TABLE group_members ADD COLUMN flags SET('notify') NOT NULL DEFAULT '';
+ALTER TABLE groups MODIFY COLUMN flags SET('wiki_desc','notif_unsub','has_ml', 'notify_all') NOT NULL DEFAULT 'notify_all';
+UPDATE groups SET flags = CONCAT(flags, ',', 'notify_all') WHERE NOT FIND_IN_SET('notify_all', flags);
 
 -- vim:set syntax=mysql: