Changeset 4964

Show
Ignore:
Timestamp:
11/02/09 06:21:40 (4 weeks ago)
Author:
takayama
Message:

* Fixed to run 33-ddl-postgres.t successfully. bugid:102786

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/greyhound/lib/MT/ObjectDriver/DDL/Pg.pm

    r4196 r4964  
    108108    return undef if $sth->err; 
    109109    return undef unless %$attr; 
     110 
     111    my @key_column_names = $dbh->primary_key(undef, undef, $table_name); 
     112    my $key_columns = {}; 
     113    foreach ( @key_column_names ) { 
     114        $key_columns->{$_} = 1; 
     115    } 
    110116 
    111117    my $defs = {}; 
     
    127133        } 
    128134        if ( $col->{PRIMARY_KEY} ) { 
     135            $defs->{$colname}{key} = 1; 
     136        } elsif ( exists $key_columns->{$field_prefix.'_'.$colname} ) { 
    129137            $defs->{$colname}{key} = 1; 
    130138        }