[vhffs-dev] [453] the large SQL modifications WAR begin..... |
[ Thread Index |
Date Index
| More vhffs.org/vhffs-dev Archives
]
Revision: 453
Author: gradator
Date: 2007-02-16 01:26:25 +0000 (Fri, 16 Feb 2007)
Log Message:
-----------
the large SQL modifications WAR begin..... nooooooowwwwwwwwwwww (for those who remember duneII introduction)
Modified Paths:
--------------
branches/vhffs_4.1/vhffs-compat/4.0.sql
Modified: branches/vhffs_4.1/vhffs-compat/4.0.sql
===================================================================
--- branches/vhffs_4.1/vhffs-compat/4.0.sql 2007-02-15 23:11:08 UTC (rev 452)
+++ branches/vhffs_4.1/vhffs-compat/4.0.sql 2007-02-16 01:26:25 UTC (rev 453)
@@ -27,3 +27,77 @@
ALTER TABLE vhffs_users ALTER gid DROP NOT NULL;
DROP TABLE vhffs_largefile CASCADE;
+
+-- 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;
+
+-- merge vhffs_user_info to vhffs_users
+ALTER TABLE vhffs_users ADD COLUMN date_creation timestamp;
+UPDATE vhffs_users SET date_creation=vhffs_user_info.date_creation WHERE vhffs_users.uid=vhffs_user_info.uid;
+ALTER TABLE vhffs_users ADD COLUMN firstname varchar(250);
+UPDATE vhffs_users SET firstname=vhffs_user_info.firstname WHERE vhffs_users.uid=vhffs_user_info.uid;
+ALTER TABLE vhffs_users ADD COLUMN lastname varchar(250);
+UPDATE vhffs_users SET lastname=vhffs_user_info.lastname WHERE vhffs_users.uid=vhffs_user_info.uid;
+ALTER TABLE vhffs_users ADD COLUMN address text;
+UPDATE vhffs_users SET address=vhffs_user_info.address WHERE vhffs_users.uid=vhffs_user_info.uid;
+ALTER TABLE vhffs_users ADD COLUMN zipcode varchar(16);
+UPDATE vhffs_users SET zipcode=vhffs_user_info.zipcode WHERE vhffs_users.uid=vhffs_user_info.uid;
+ALTER TABLE vhffs_users ADD COLUMN city varchar(250);
+UPDATE vhffs_users SET city=vhffs_user_info.city WHERE vhffs_users.uid=vhffs_user_info.uid;
+ALTER TABLE vhffs_users ADD COLUMN country varchar(250);
+UPDATE vhffs_users SET country=vhffs_user_info.country WHERE vhffs_users.uid=vhffs_user_info.uid;
+ALTER TABLE vhffs_users ADD COLUMN mail varchar(200);
+UPDATE vhffs_users SET mail=vhffs_user_info.mail WHERE vhffs_users.uid=vhffs_user_info.uid;
+ALTER TABLE vhffs_users ADD COLUMN gpg_key varchar(250);
+UPDATE vhffs_users SET gpg_key=vhffs_user_info.gpg_key WHERE vhffs_users.uid=vhffs_user_info.uid;
+
+-- merge vhffs_notes to vhffs_users
+ALTER TABLE vhffs_users ADD COLUMN note int4;
+UPDATE vhffs_users SET note=vhffs_notes.note WHERE vhffs_users.object_id=vhffs_notes.object_id;
+
+-- merge vhffs_panel_user_prefs to vhffs_users
+ALTER TABLE vhffs_users ADD COLUMN language varchar(16);
+UPDATE vhffs_users SET language=vhffs_panel_user_prefs.language WHERE vhffs_users.uid=vhffs_panel_user_prefs.uid;
+ALTER TABLE vhffs_users ADD COLUMN theme varchar(250);
+UPDATE vhffs_users SET theme=vhffs_panel_user_prefs.theme WHERE vhffs_users.uid=vhffs_panel_user_prefs.uid;
+
+-- merge vhffs_groups_info to vhffs_groups
+ALTER TABLE vhffs_groups ADD COLUMN owner_uid int4;
+UPDATE vhffs_groups SET owner_uid=vhffs_groups_info.owner_uid WHERE vhffs_groups.gid=vhffs_groups_info.gid;
+ALTER TABLE vhffs_groups ADD COLUMN uid_mod int4;
+UPDATE vhffs_groups SET uid_mod=vhffs_groups_info.uid_mod WHERE vhffs_groups.gid=vhffs_groups_info.gid;
+
+-- merge vhffs_ml_prefs to vhffs_ml
+ALTER TABLE vhffs_ml ADD COLUMN admin varchar(250);
+UPDATE vhffs_ml SET admin=vhffs_ml_prefs.admin WHERE vhffs_ml.ml_id=vhffs_ml_prefs.ml_id;
+ALTER TABLE vhffs_ml ADD COLUMN open_post boolean;
+UPDATE vhffs_ml SET open_post='f' WHERE vhffs_ml.ml_id=vhffs_ml_prefs.ml_id AND vhffs_ml_prefs.open_post='0';
+UPDATE vhffs_ml SET open_post='t' WHERE vhffs_ml.ml_id=vhffs_ml_prefs.ml_id AND vhffs_ml_prefs.open_post='1';
+ALTER TABLE vhffs_ml ADD COLUMN open_archive boolean;
+UPDATE vhffs_ml SET open_archive='f' WHERE vhffs_ml.ml_id=vhffs_ml_prefs.ml_id AND vhffs_ml_prefs.open_archive='0';
+UPDATE vhffs_ml SET open_archive='t' WHERE vhffs_ml.ml_id=vhffs_ml_prefs.ml_id AND vhffs_ml_prefs.open_archive='1';
+ALTER TABLE vhffs_ml ADD COLUMN open_sub boolean;
+UPDATE vhffs_ml SET open_sub='f' WHERE vhffs_ml.ml_id=vhffs_ml_prefs.ml_id AND vhffs_ml_prefs.open_sub='0';
+UPDATE vhffs_ml SET open_sub='t' WHERE vhffs_ml.ml_id=vhffs_ml_prefs.ml_id AND vhffs_ml_prefs.open_sub='1';
+ALTER TABLE vhffs_ml ADD COLUMN reply_to boolean;
+UPDATE vhffs_ml SET reply_to='f' WHERE vhffs_ml.ml_id=vhffs_ml_prefs.ml_id AND vhffs_ml_prefs.reply_to='0';
+UPDATE vhffs_ml SET reply_to='t' WHERE vhffs_ml.ml_id=vhffs_ml_prefs.ml_id AND vhffs_ml_prefs.reply_to='1';
+ALTER TABLE vhffs_ml ADD COLUMN moderated boolean;
+UPDATE vhffs_ml SET moderated='f' WHERE vhffs_ml.ml_id=vhffs_ml_prefs.ml_id AND vhffs_ml_prefs.moderated='0';
+UPDATE vhffs_ml SET moderated='t' WHERE vhffs_ml.ml_id=vhffs_ml_prefs.ml_id AND vhffs_ml_prefs.moderated='1';
+ALTER TABLE vhffs_ml ADD COLUMN url varchar(512);
+UPDATE vhffs_ml SET url=vhffs_ml_prefs.url WHERE vhffs_ml.ml_id=vhffs_ml_prefs.ml_id;