finish preserve_case support
[dbsrgits/DBIx-Class-Schema-Loader.git] / lib / DBIx / Class / Schema / Loader / DBI / Oracle.pm
index 1bfb32b..a3fb1eb 100644 (file)
@@ -41,8 +41,8 @@ sub _setup {
         $self->preserve_case(0);
     }
     elsif ($self->preserve_case) {
-        $self->schema->storage->quote_char('"');
-        $self->schema->storage->name_sep('.');
+        $self->schema->storage->sql_maker->quote_char('"');
+        $self->schema->storage->sql_maker->name_sep('.');
     }
 }
 
@@ -81,7 +81,7 @@ sub _table_columns {
 
     my $sth = $dbh->column_info(undef, $self->db_schema, $self->_uc($table), '%');
 
-    return [ map lc($_->{COLUMN_NAME}), @{ $sth->fetchall_arrayref({ COLUMN_NAME => 1 }) || [] } ];
+    return [ map $self->_lc($_->{COLUMN_NAME}), @{ $sth->fetchall_arrayref({ COLUMN_NAME => 1 }) || [] } ];
 }
 
 sub _table_uniq_info {
@@ -101,7 +101,7 @@ sub _table_uniq_info {
     $sth->execute($self->_uc($table),$self->{db_schema} );
     my %constr_names;
     while(my $constr = $sth->fetchrow_arrayref) {
-        my $constr_name = $constr->[0];
+        my $constr_name = $self->_lc($constr->[0]);
         my $constr_col  = $self->_lc($constr->[1]);
         $constr_name =~ s/\Q$self->{_quoter}\E//;
         $constr_col  =~ s/\Q$self->{_quoter}\E//;
@@ -232,10 +232,11 @@ AND upper(trigger_type) LIKE '%BEFORE EACH ROW%' AND lower(triggering_event) LIK
         } 
 
         if ((eval { lc(${ $info->{default_value} }) }||'') eq 'sysdate') {
-            $info->{original}{default_value} = $info->{default_value};
-
             my $current_timestamp  = 'current_timestamp';
             $info->{default_value} = \$current_timestamp;
+
+            my $sysdate = 'sysdate';
+            $info->{original}{default_value} = \$sysdate;
         }
     }