rels are still fucked in sybase
[dbsrgits/DBIx-Class-Schema-Loader.git] / lib / DBIx / Class / Schema / Loader / Base.pm
index d79618d..ff336a0 100644 (file)
@@ -688,25 +688,23 @@ sub _setup_src_meta {
         $self->_dbic_stmt($table_class,'add_columns',@$cols);
     }
     else {
-        my %col_info_lc;
         for my $col (keys %$col_info) {
-            my $lc_col = lc $col;
-            $col_info_lc{$lc_col} = $col_info->{$_};
-
-            $col_info_lc{$lc_col}->{accessor} = $lc_col
-                if $col ne $lc_col;
+            $col_info->{$col}{accessor} = lc $col
+                if $col ne lc($col);
         }
 
         my $fks = $self->_table_fk_info($table);
+
         for my $fkdef (@$fks) {
             for my $col (@{ $fkdef->{local_columns} }) {
-                $col_info_lc{$col}->{is_foreign_key} = 1;
+                $col = lc $col unless $self->_is_case_sensitive;
+                $col_info->{$col}{is_foreign_key} = 1;
             }
         }
         $self->_dbic_stmt(
             $table_class,
             'add_columns',
-            map { $_, ($col_info_lc{$_}||{}) } @$cols
+            map { $_, ($col_info->{$_}||{}) } @$cols
         );
     }
 
@@ -830,6 +828,20 @@ sub _ext_stmt {
     push(@{$self->{_ext_storage}->{$class}}, $stmt);
 }
 
+sub _quote_table_name {
+    my ($self, $table) = @_;
+
+    my $qt = $self->schema->storage->sql_maker->quote_char;
+
+    if (ref $qt) {
+        return $qt->[0] . $table . $qt->[1];
+    }
+
+    return $qt . $table . $qt;
+}
+
+sub _is_case_sensitive { 0 }
+
 =head2 monikers
 
 Returns a hashref of loaded table to moniker mappings.  There will