[freeside-commits] freeside/FS/FS reason.pm,1.5,1.6
Ivan,,,
ivan at wavetail.420.am
Sun Feb 10 18:38:00 PST 2008
Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail:/tmp/cvs-serv28255
Modified Files:
reason.pm
Log Message:
upgrading reason table not quite working with mysql, hopefully no old installs need this, new ones should be fine hopefully
Index: reason.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/reason.pm,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- reason.pm 11 Feb 2008 02:03:51 -0000 1.5
+++ reason.pm 11 Feb 2008 02:37:58 -0000 1.6
@@ -137,7 +137,9 @@
$column = dbdef->table($self->table)->column('reason');
my $columndef = $column->line($dbh);
$columndef =~ s/varchar\(\d+\)/text/i;
+
if ( $dbh->{Driver}->{Name} eq 'Pg' ) {
+
my $notnull = $columndef =~ s/not null//i;
push @sql,"ALTER TABLE $table RENAME reason TO freeside_upgrade_reason";
push @sql,"ALTER TABLE $table ADD $columndef";
@@ -145,9 +147,14 @@
push @sql,"ALTER TABLE $table ALTER reason SET NOT NULL"
if $notnull;
push @sql,"ALTER TABLE $table DROP freeside_upgrade_reason";
- }elsif( $dbh->{Driver}->{Name} =~ /^mysql/i ){
- push @sql,"ALTER TABLE $table MODIFY reason ". $column->line($dbh);
- }else{
+
+ } elsif ( $dbh->{Driver}->{Name} =~ /^mysql/i ){
+
+ #crap, this isn't working
+ #push @sql,"ALTER TABLE $table MODIFY reason ". $column->line($dbh);
+ warn "WARNING: reason table upgrade not yet supported for mysql, sorry";
+
+ } else {
die "watchu talkin' 'bout, Willis? (unsupported database type)";
}
More information about the freeside-commits
mailing list