Mercurial > pub > Impl
comparison Lib/IMPL/ORM/Schema/TransformToSQL.pm @ 168:6148f89bb7bf
IMPL::SQL::Schema::Traits::Diff alfa version
IMPL::lang added hash traits
author | sourcer |
---|---|
date | Mon, 16 May 2011 04:30:38 +0400 |
parents | 4267a2ac3d46 |
children |
comparison
equal
deleted
inserted
replaced
167:1f7a6d762394 | 168:6148f89bb7bf |
---|---|
79 my $sqlSchema = $ctx->{Schema}; | 79 my $sqlSchema = $ctx->{Schema}; |
80 my $table = $sqlSchema->Tables->{$relation->parentNode->entityName}; | 80 my $table = $sqlSchema->Tables->{$relation->parentNode->entityName}; |
81 my $tableForeign = $sqlSchema->Tables->{$relation->target}; | 81 my $tableForeign = $sqlSchema->Tables->{$relation->target}; |
82 my $prefix = $relation->name; | 82 my $prefix = $relation->name; |
83 | 83 |
84 my @fkColumns = @{$tableForeign->PrimaryKey->Columns}; | 84 my @fkColumns = $tableForeign->PrimaryKey->columns; |
85 | 85 |
86 if (@fkColumns > 1) { | 86 if (@fkColumns > 1) { |
87 @fkColumns = map | 87 @fkColumns = map |
88 $table->InsertColumn({ | 88 $table->InsertColumn({ |
89 Name => $prefix . $_->Name, | 89 Name => $prefix . $_->Name, |
109 my $sqlSchema = $ctx->{Schema}; | 109 my $sqlSchema = $ctx->{Schema}; |
110 my $table = $sqlSchema->Tables->{$relation->parentNode->entityName}; | 110 my $table = $sqlSchema->Tables->{$relation->parentNode->entityName}; |
111 my $tableForeign = $sqlSchema->Tables->{$relation->target}; | 111 my $tableForeign = $sqlSchema->Tables->{$relation->target}; |
112 my $prefix = $relation->name; | 112 my $prefix = $relation->name; |
113 | 113 |
114 my @fkColumns = @{$table->PrimaryKey->Columns}; | 114 my @fkColumns = $table->PrimaryKey->columns; |
115 | 115 |
116 if (@fkColumns > 1 ) { | 116 if (@fkColumns > 1 ) { |
117 @fkColumns = map $tableForeign->InsertColumn({ | 117 @fkColumns = map $tableForeign->InsertColumn({ |
118 Name => $prefix . $_->Name, | 118 Name => $prefix . $_->Name, |
119 Type => $_->Type, | 119 Type => $_->Type, |