[vhffs-dev] [svn] commit: r286 - in /branches/vhffs_4.1/vhffs-backend/src/pgsql: alter_from4.0_tocurrent.sql alter_from4.0pre1_tocurrent.sql |
[ Thread Index |
Date Index
| More vhffs.org/vhffs-dev Archives
]
- To: vhffs-dev@xxxxxxxxx
- Subject: [vhffs-dev] [svn] commit: r286 - in /branches/vhffs_4.1/vhffs-backend/src/pgsql: alter_from4.0_tocurrent.sql alter_from4.0pre1_tocurrent.sql
- From: vhffs-dev@xxxxxxxxx
- Date: Mon, 06 Nov 2006 08:35:30 -0000
Author: beuss
Date: Mon Nov 6 09:35:29 2006
New Revision: 286
Log:
Added transition scripts to prepare use of sequences in code
Added:
branches/vhffs_4.1/vhffs-backend/src/pgsql/alter_from4.0_tocurrent.sql
Modified:
branches/vhffs_4.1/vhffs-backend/src/pgsql/alter_from4.0pre1_tocurrent.sql
Modified: branches/vhffs_4.1/vhffs-backend/src/pgsql/alter_from4.0pre1_tocurrent.sql
==============================================================================
--- branches/vhffs_4.1/vhffs-backend/src/pgsql/alter_from4.0pre1_tocurrent.sql (original)
+++ branches/vhffs_4.1/vhffs-backend/src/pgsql/alter_from4.0pre1_tocurrent.sql Mon Nov 6 09:35:29 2006
@@ -28,7 +28,63 @@
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
-*/
+*/
+
+-- These are the sequences needed for post VHFFS-4.0pre1
+-- To know if we need to update this, we should try a SELECT COUNT(*) FROM pg_class WHERE relname = 'seq_id_groups'
+
+-- Drop former (unused) sequences...
+DROP SEQUENCE seq_id_groups;
+DROP SEQUENCE seq_id_users;
+DROP SEQUENCE seq_id_mx;
+DROP SEQUENCE seq_id_acl;
+DROP SEQUENCE seq_id_cvs;
+DROP SEQUENCE seq_id_httpd;
+DROP SEQUENCE seq_id_ml;
+DROP SEQUENCE seq_id_sub;
+DROP SEQUENCE seq_id_mailings;
+DROP SEQUENCE seq_virtualuid;
+DROP SEQUENCE seq_virtualgid;
+DROP SEQUENCE seq_id_pgsql;
+DROP SEQUENCE seq_id_svn;
+DROP SEQUENCE seq_id_svn_users;
+DROP SEQUENCE seq_id_user_group;
+DROP SEQUENCE seq_id_mysql;
+DROP SEQUENCE seq_id_dns;
+DROP SEQUENCE seq_id_history;
+DROP SEQUENCE seq_id_objects;
+
+-- Create the same sequences as SERIAL would
+CREATE SEQUENCE vhffs_object_object_id_seq;
+ALTER TABLE vhffs_object ALTER COLUMN object_id SET DEFAULT nextval('vhffs_object_object_id_seq');
+CREATE SEQUENCE vhffs_acl_acl_id_seq;
+ALTER TABLE vhffs_acl ALTER COLUMN acl_id SET DEFAULT nextval('vhffs_acl_acl_id_seq');
+-- vhffs_group_gid_seq already exists
+-- vhffs_users_uid_seq already exists
+-- vhffs_confirmation_cid_seq already exists
+CREATE SEQUENCE vhffs_cvs_cvs_id_seq;
+ALTER TABLE vhffs_cvs ALTER COLUMN cvs_id SET DEFAULT nextval('vhffs_cvs_cvs_id_seq');
+CREATE SEQUENCE vhffs_dns_global_dns_id_seq;
+ALTER TABLE vhffs_dns_global ALTER COLUMN dns_id SET DEFAULT nextval('vhffs_dns_global_dns_id_seq');
+-- vhffs_dns_rr_id_seq already exists
+-- vhffs_dns_soa_id_seq already exists
+CREATE SEQUENCE vhffs_httpd_httpd_id_seq;
+ALTER TABLE vhffs_httpd ALTER COLUMN httpd_id SET DEFAULT nextval('vhffs_httpd_httpd_id_seq');
+-- vhffs_largefile_file_id_seq already exists
+-- vhffs_mailings_id_mailing_seq already exists
+CREATE SEQUENCE vhffs_mxdomain_mxdomain_id_seq;
+ALTER TABLE vhffs_mxdomain ALTER COLUMN mxdomain_id SET DEFAULT nextval('vhffs_mxdomain_mxdomain_id_seq');
+CREATE SEQUENCE vhffs_ml_ml_id_seq;
+ALTER TABLE vhffs_ml ALTER COLUMN ml_id SET DEFAULT nextval('vhffs_ml_ml_id_seq');
+CREATE SEQUENCE vhffs_ml_subscribers_sub_id_seq;
+ALTER TABLE vhffs_ml_subscribers ALTER COLUMN sub_id SET DEFAULT nextval('vhffs_ml_subscribers_sub_id_seq');
+CREATE SEQUENCE vhffs_mysql_mysql_id_seq;
+ALTER TABLE vhffs_mysql ALTER COLUMN mysql_id SET DEFAULT nextval('vhffs_mysql_mysql_id_seq');
+CREATE SEQUENCE vhffs_history_history_id_seq;
+ALTER TABLE vhffs_history ALTER COLUMN history_id SET DEFAULT nextval('vhffs_history_history_id_seq');
+CREATE SEQUENCE vhffs_pgsql_pgsql_id_seq;
+ALTER TABLE vhffs_pgsql ALTER COLUMN pgsql_id SET DEFAULT nextval('vhffs_pgsql_pgsql_id_seq');
+-- vhffs_svn_svn_id_seq already exists
CREATE TABLE vhffs_repository
(
@@ -50,3 +106,5 @@
SELECT users.username, users.passwd, user_info.firstname, user_info.lastname, user_info.mail, user_info.date_creation, object.state
FROM vhffs_users users, vhffs_user_info user_info, vhffs_object object
WHERE user_info.uid=users.uid AND object.object_id=users.object_id;
+
+\i alter_from4.0_tocurrent.sql