[vhffs-dev] [536] prepare vhffs db for the new (powerful, hum hum) listengine ;)

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


Revision: 536
Author:   gradator
Date:     2007-03-31 00:32:02 +0000 (Sat, 31 Mar 2007)

Log Message:
-----------
prepare vhffs db for the new (powerful, hum hum) listengine ;)

Modified Paths:
--------------
    branches/vhffs_4.1/vhffs-backend/src/pgsql/initdb.sql
    branches/vhffs_4.1/vhffs-compat/4.0.sql


Modified: branches/vhffs_4.1/vhffs-backend/src/pgsql/initdb.sql
===================================================================
--- branches/vhffs_4.1/vhffs-backend/src/pgsql/initdb.sql	2007-03-30 20:22:05 UTC (rev 535)
+++ branches/vhffs_4.1/vhffs-backend/src/pgsql/initdb.sql	2007-03-31 00:32:02 UTC (rev 536)
@@ -214,12 +214,11 @@
 	owner_gid int4,
 	object_id int4,
 	admin varchar(250) NOT NULL,
-	open_post boolean,
-	open_archive boolean,
-	open_sub boolean,
+	sub_ctrl int4,
+	post_ctrl int4,
 	reply_to boolean,
-	moderated boolean,
-    signature varchar(250),
+	open_archive boolean,
+	signature varchar(250),
 	CONSTRAINT vhffs_ml_pkey PRIMARY KEY (ml_id)
 ) WITH OIDS;
 

Modified: branches/vhffs_4.1/vhffs-compat/4.0.sql
===================================================================
--- branches/vhffs_4.1/vhffs-compat/4.0.sql	2007-03-30 20:22:05 UTC (rev 535)
+++ branches/vhffs_4.1/vhffs-compat/4.0.sql	2007-03-31 00:32:02 UTC (rev 536)
@@ -130,6 +130,26 @@
 ALTER TABLE vhffs_ml_subscribers DROP active;
 ALTER TABLE vhffs_ml_subscribers ALTER COLUMN hash DROP NOT NULL;
 
+
+-- modify vhffs_ml, drop columns open_post, open_sub, moderated, replace by sub_ctrl and mod_ctrl
+--   sub_ctrl, 0 = open, 1 = open but moderated (approval required), 2 = closed
+--   post_ctrl, 0 = open, 1 = moderated for all, 2 = moderated for non members and open for members, 3 = members only,
+--              4 = members only and moderated, 5 = admins only
+ALTER TABLE vhffs_ml ADD COLUMN sub_ctrl int4;
+ALTER TABLE vhffs_ml ADD COLUMN post_ctrl int4;
+UPDATE vhffs_ml SET sub_ctrl = 0;
+UPDATE vhffs_ml SET sub_ctrl = 0 where open_sub = 't';
+UPDATE vhffs_ml SET sub_ctrl = 2 where open_sub = 'f';
+UPDATE vhffs_ml SET post_ctrl = 0;
+UPDATE vhffs_ml SET post_ctrl = 0 where open_post = 't' and moderated = 'f';
+UPDATE vhffs_ml SET post_ctrl = 1 where open_post = 't' and moderated = 't';
+UPDATE vhffs_ml SET post_ctrl = 3 where open_post = 'f' and moderated = 'f';
+UPDATE vhffs_ml SET post_ctrl = 4 where open_post = 'f' and moderated = 't';
+ALTER TABLE vhffs_ml DROP COLUMN open_sub;
+ALTER TABLE vhffs_ml DROP COLUMN open_post;
+ALTER TABLE vhffs_ml DROP COLUMN moderated;
+
+
 -- rename vhffs_dns_global to vhffs_dns
 ALTER TABLE vhffs_dns_global RENAME TO vhffs_dns;
 


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