summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorivan <ivan>2010-01-09 10:03:53 +0000
committerivan <ivan>2010-01-09 10:03:53 +0000
commit7e0aae7956b9f07d88295a350e560978032847fd (patch)
treecb22ab3b48b9777a728dff4bf73022aa9be933c3
parentd65f34f3bebfce5f6110bf6179ed1180509cd947 (diff)
need DBIx::DBSchema w/quoted_default to make this all work right :/
-rw-r--r--FS/FS/Record.pm8
1 files changed, 4 insertions, 4 deletions
diff --git a/FS/FS/Record.pm b/FS/FS/Record.pm
index ef8ef0026..201e7b23c 100644
--- a/FS/FS/Record.pm
+++ b/FS/FS/Record.pm
@@ -15,7 +15,7 @@ use Locale::Country;
use Text::CSV_XS;
use File::Slurp qw( slurp );
use DBI qw(:sql_types);
-use DBIx::DBSchema 0.33;
+use DBIx::DBSchema 0.38;
use FS::UID qw(dbh getotaker datasrc driver_name);
use FS::CurrentUser;
use FS::Schema qw(dbdef);
@@ -962,12 +962,12 @@ sub insert {
my $db_seq = 0;
if ( $primary_key ) {
my $col = $self->dbdef_table->column($primary_key);
-
+
$db_seq =
uc($col->type) =~ /^(BIG)?SERIAL\d?/
|| ( driver_name eq 'Pg'
&& defined($col->default)
- && $col->default =~ /^nextval\(/i
+ && $col->quoted_default =~ /^nextval\(/i
)
|| ( driver_name eq 'mysql'
&& defined($col->local)
@@ -1032,7 +1032,7 @@ sub insert {
#my $oid = $sth->{'pg_oid_status'};
#my $i_sql = "SELECT $primary_key FROM $table WHERE oid = ?";
- my $default = $self->dbdef_table->column($primary_key)->default;
+ my $default = $self->dbdef_table->column($primary_key)->quoted_default;
unless ( $default =~ /^nextval\(\(?'"?([\w\.]+)"?'/i ) {
dbh->rollback if $FS::UID::AutoCommit;
return "can't parse $table.$primary_key default value".