[vhffs-dev] [454] Same as #453 but this time it works...

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


Revision: 454
Author:   beuss
Date:     2007-02-16 11:11:43 +0000 (Fri, 16 Feb 2007)

Log Message:
-----------
Same as #453 but this time it works... Modified initdb.sql to add type field.

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-02-16 01:26:25 UTC (rev 453)
+++ branches/vhffs_4.1/vhffs-backend/src/pgsql/initdb.sql	2007-02-16 11:11:43 UTC (rev 454)
@@ -37,6 +37,7 @@
 	date_creation timestamp,
 	state varchar NOT NULL,
 	description TEXT,
+    type int4 DEFAULT 0,
 	CONSTRAINT vhffs_object_pkey PRIMARY KEY (object_id)
 ) WITH OIDS;
 

Modified: branches/vhffs_4.1/vhffs-compat/4.0.sql
===================================================================
--- branches/vhffs_4.1/vhffs-compat/4.0.sql	2007-02-16 01:26:25 UTC (rev 453)
+++ branches/vhffs_4.1/vhffs-compat/4.0.sql	2007-02-16 11:11:43 UTC (rev 454)
@@ -30,20 +30,18 @@
 
 -- add a column named "type" on object table in order to know the purpose of the object (web area, mysql, ...)
 -- existing types: unassigned[0], user[10], group[11], httpd[20], repository[21], mysql[30], pgsql[31], cvs[40], svn[41], dns[50], mail[60], ml[61]
-ALTER TABLE vhffs_object ADD COLUMN type int4;
-ALTER TABLE vhffs_object ALTER type SET DEFAULT 0;
-UPDATE vhffs_object SET type='0';
-UPDATE vhffs_object SET type='10' WHERE vhffs_users.object_id=vhffs_object.object_id;
-UPDATE vhffs_object SET type='11' WHERE vhffs_groups.object_id=vhffs_object.object_id;
-UPDATE vhffs_object SET type='20' WHERE vhffs_httpd.object_id=vhffs_object.object_id;
-UPDATE vhffs_object SET type='21' WHERE vhffs_repository.object_id=vhffs_object.object_id;
-UPDATE vhffs_object SET type='30' WHERE vhffs_mysql.object_id=vhffs_object.object_id;
-UPDATE vhffs_object SET type='31' WHERE vhffs_pgsql.object_id=vhffs_object.object_id;
-UPDATE vhffs_object SET type='40' WHERE vhffs_cvs.object_id=vhffs_object.object_id;
-UPDATE vhffs_object SET type='41' WHERE vhffs_svn.object_id=vhffs_object.object_id;
-UPDATE vhffs_object SET type='50' WHERE vhffs_dns_global.object_id=vhffs_object.object_id;
-UPDATE vhffs_object SET type='60' WHERE vhffs_mxdomain.object_id=vhffs_object.object_id;
-UPDATE vhffs_object SET type='61' WHERE vhffs_ml.object_id=vhffs_object.object_id;
+ALTER TABLE vhffs_object ADD COLUMN type int4 DEFAULT 0;
+UPDATE vhffs_object SET type='10' WHERE object_id IN (SELECT object_id FROM vhffs_users);
+UPDATE vhffs_object SET type='11' WHERE object_id IN (SELECT object_id FROM vhffs_groups);
+UPDATE vhffs_object SET type='20' WHERE object_id IN (SELECT object_id FROM vhffs_httpd);
+UPDATE vhffs_object SET type='21' WHERE object_id IN (SELECT object_id FROM vhffs_repository);
+UPDATE vhffs_object SET type='30' WHERE object_id IN (SELECT object_id FROM vhffs_mysql);
+UPDATE vhffs_object SET type='31' WHERE object_id IN (SELECT object_id FROM vhffs_pgsql);
+UPDATE vhffs_object SET type='40' WHERE object_id IN (SELECT object_id FROM vhffs_cvs);
+UPDATE vhffs_object SET type='41' WHERE object_id IN (SELECT object_id FROM vhffs_svn);
+UPDATE vhffs_object SET type='50' WHERE object_id IN (SELECT object_id FROM vhffs_dns_global);
+UPDATE vhffs_object SET type='60' WHERE object_id IN (SELECT object_id FROM vhffs_mxdomain);
+UPDATE vhffs_object SET type='61' WHERE object_id IN (SELECT object_id FROM vhffs_ml);
 
 -- merge vhffs_user_info to vhffs_users
 ALTER TABLE vhffs_users ADD COLUMN date_creation timestamp;


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