Skip to content

Commit

Permalink
Fix bug phalcon#438: Error duplicate columns while Auto-generate migr…
Browse files Browse the repository at this point in the history
…ation Postgres (phalcon#438)
  • Loading branch information
Arrim committed Oct 15, 2016
1 parent 58e6b65 commit 353d07d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/Phalcon/Mvc/Model/Migration.php
Original file line number Diff line number Diff line change
Expand Up @@ -338,8 +338,8 @@ public static function generate($version, $table, $exportData = null)
$referenceDefinition = [];
$referenceDefinition[] = "'referencedSchema' => '".$dbReference->getReferencedSchema()."'";
$referenceDefinition[] = "'referencedTable' => '".$dbReference->getReferencedTable()."'";
$referenceDefinition[] = "'columns' => [".join(",", $columns)."]";
$referenceDefinition[] = "'referencedColumns' => [".join(",", $referencedColumns)."]";
$referenceDefinition[] = "'columns' => [".join(",", array_unique($columns))."]";
$referenceDefinition[] = "'referencedColumns' => [".join(",", array_unique($referencedColumns))."]";
$referenceDefinition[] = "'onUpdate' => '".$dbReference->getOnUpdate()."'";
$referenceDefinition[] = "'onDelete' => '".$dbReference->getOnDelete()."'";

Expand Down

0 comments on commit 353d07d

Please sign in to comment.