[interchange-cvs] interchange - heins modified 2 files

interchange-core@interchange.redhat.com interchange-core@interchange.redhat.com
Fri Jun 28 01:07:00 2002


User:      heins
Date:      2002-06-28 05:06:05 GMT
Modified:  lib/Vend/Table DBI.pm
Modified:  lib/Vend Config.pm
Log:
	* Add support for PRECREATE to run arbitrary SQL command prior
	  to table creation, ala POSTCREATE. (Used to create sequences
	  among other possible uses.)

Revision  Changes    Path
2.19      +13 -2     interchange/lib/Vend/Table/DBI.pm


rev 2.19, prev_rev 2.18
Index: DBI.pm
===================================================================
RCS file: /anon_cvs/repository/interchange/lib/Vend/Table/DBI.pm,v
retrieving revision 2.18
retrieving revision 2.19
diff -u -r2.18 -r2.19
--- DBI.pm	17 Jun 2002 22:24:12 -0000	2.18
+++ DBI.pm	28 Jun 2002 05:06:05 -0000	2.19
@@ -1,6 +1,6 @@
 # Vend::Table::DBI - Access a table stored in an DBI/DBD database
 #
-# $Id: DBI.pm,v 2.18 2002/06/17 22:24:12 jon Exp $
+# $Id: DBI.pm,v 2.19 2002/06/28 05:06:05 mheins Exp $
 #
 # Copyright (C) 1996-2002 Red Hat, Inc. <interchange@redhat.com>
 #
@@ -20,7 +20,7 @@
 # MA  02111-1307  USA.
 
 package Vend::Table::DBI;
-$VERSION = substr(q$Revision: 2.18 $, 10);
+$VERSION = substr(q$Revision: 2.19 $, 10);
 
 use strict;
 
@@ -319,6 +319,17 @@
 	$keycol = 0 unless defined $keycol;
 	$config->{KEY_INDEX} = $keycol;
 	$config->{KEY} = $key;
+
+	if(ref $config->{PRECREATE}) {
+		for(@{$config->{PRECREATE}} ) {
+			$db->do($_) 
+				or ::logError(
+								"DBI: Post creation query '%s' failed: %s" ,
+								$_,
+								$DBI::errstr,
+					);
+		}
+	}
 
 	if($config->{CREATE_SQL}) {
 #::logDebug("Trying to create with specified CREATE_SQL:\n$config->{CREATE_SQL}");



2.51      +3 -2      interchange/lib/Vend/Config.pm


rev 2.51, prev_rev 2.50
Index: Config.pm
===================================================================
RCS file: /anon_cvs/repository/interchange/lib/Vend/Config.pm,v
retrieving revision 2.50
retrieving revision 2.51
diff -u -r2.50 -r2.51
--- Config.pm	28 Jun 2002 05:00:25 -0000	2.50
+++ Config.pm	28 Jun 2002 05:06:05 -0000	2.51
@@ -1,6 +1,6 @@
 # Vend::Config - Configure Interchange
 #
-# $Id: Config.pm,v 2.50 2002/06/28 05:00:25 mheins Exp $
+# $Id: Config.pm,v 2.51 2002/06/28 05:06:05 mheins Exp $
 #
 # Copyright (C) 1996-2002 Red Hat, Inc. <interchange@redhat.com>
 #
@@ -44,7 +44,7 @@
 use Vend::Parse;
 use Vend::Util;
 
-$VERSION = substr(q$Revision: 2.50 $, 10);
+$VERSION = substr(q$Revision: 2.51 $, 10);
 
 my %CDname;
 
@@ -2550,6 +2550,7 @@
 my %Ary_ref = (   qw!
 						NAME                NAME
 						BINARY              BINARY 
+						PRECREATE           PRECREATE 
 						POSTCREATE          POSTCREATE 
 						INDEX               INDEX 
 						ALTERNATE_DSN       ALTERNATE_DSN