[vhffs-dev] [733] Migration script is now fixed and work with tuxfamily' s production database ( which means that it is going to work with any database, whatever scrambled it is :D)

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


Revision: 733
Author:   gradator
Date:     2007-07-29 15:52:48 +0000 (Sun, 29 Jul 2007)

Log Message:
-----------
Migration script is now fixed and work with tuxfamily's production database (which means that it is going to work with any database, whatever scrambled it is :D)

Modified Paths:
--------------
    trunk/vhffs-compat/4.0pre1.sql
    trunk/vhffs-compat/updatedb.pl


Modified: trunk/vhffs-compat/4.0pre1.sql
===================================================================
--- trunk/vhffs-compat/4.0pre1.sql	2007-07-17 14:50:27 UTC (rev 732)
+++ trunk/vhffs-compat/4.0pre1.sql	2007-07-29 15:52:48 UTC (rev 733)
@@ -66,8 +66,8 @@
 -- 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');
+CREATE SEQUENCE vhffs_dns_global_id_seq;
+ALTER TABLE vhffs_dns_global ALTER COLUMN dns_id SET DEFAULT nextval('vhffs_dns_global_id_seq');
 -- vhffs_dns_rr_id_seq already exists
 -- vhffs_dns_soa_id_seq already exists
 CREATE SEQUENCE vhffs_httpd_httpd_id_seq;

Modified: trunk/vhffs-compat/updatedb.pl
===================================================================
--- trunk/vhffs-compat/updatedb.pl	2007-07-17 14:50:27 UTC (rev 732)
+++ trunk/vhffs-compat/updatedb.pl	2007-07-29 15:52:48 UTC (rev 733)
@@ -42,7 +42,8 @@
 
 use strict;
 
-my $SQL_DIR = '%VHFFS_BACKEND_DIR%/';
+#my $SQL_DIR = '%VHFFS_BACKEND_DIR%/';
+my $SQL_DIR = '/root/vhffs/vhffs/trunk/vhffs-backend/src/pgsql/';
 
 
 sub confirm($) {
@@ -147,6 +148,7 @@
 die("unable to open ${SQL_DIR}.initdb.sql : $!, DB not upgraded\n") unless($INIT_DB);
 
 print "Let's drop foreign keys...\n";
+flush STDOUT;
 
 # Fetches and removes all foreign key constraints
 
@@ -181,6 +183,7 @@
 # Create new foreign key constraints based on initdb.sql content
 
 print "Creating new foreign key, indexes and unique keys...\n";
+flush STDOUT;
 
 while(<$INIT_DB>) {
     if(/(ALTER TABLE\s+(.*?)\s+ADD CONSTRAINT\s+(.*?)\s+FOREIGN KEY.*);\s*$/i) {
@@ -197,7 +200,10 @@
 
 $INIT_DB->close();
 
+if ( 0 )  {
+
 print "Fixing \\s in objects' description...";
+flush STDOUT;
 
 my $rows = $dbh->selectall_arrayref('SELECT object_id, description FROM vhffs_object');
 
@@ -211,6 +217,7 @@
 
 
 print "Fixing \\s in objects' history...";
+flush STDOUT;
 
 $rows = $dbh->selectall_arrayref('SELECT history_id, message FROM vhffs_history');
 
@@ -223,6 +230,7 @@
 print " done.\n";
 
 print "Fixing \\s in users' informations...";
+flush STDOUT;
 
 $rows = $dbh->selectall_arrayref('SELECT uid, shell FROM vhffs_users');
 
@@ -245,3 +253,4 @@
 print " done.\n";
 
 
+}


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