diff --git a/src/Propel/Generator/Model/Table.php b/src/Propel/Generator/Model/Table.php index e89316c3bb..144e933426 100644 --- a/src/Propel/Generator/Model/Table.php +++ b/src/Propel/Generator/Model/Table.php @@ -791,7 +791,7 @@ public function setupReferrers($throwErrors = false) $foreignPrimaryKeys = $foreignTable->getPrimaryKey(); // check all keys are referenced in foreign key foreach ($foreignPrimaryKeys as $foreignPrimaryKey) { - if (!$foreignPrimaryKey->hasReferrer($foreignKey) && $throwErrors) { + if (!$foreignPrimaryKey->hasReferrer($foreignKey) && !$foreignKey->isSkipSql() && $throwErrors) { // foreign primary key is not being referenced in foreign key throw new BuildException(sprintf( 'Table "%s" contains a foreign key to table "%s" but does not have a reference to foreign primary key "%s"', diff --git a/tests/Propel/Tests/Issues/Issue1388Test.php b/tests/Propel/Tests/Issues/Issue1388Test.php new file mode 100644 index 0000000000..da6b500c1f --- /dev/null +++ b/tests/Propel/Tests/Issues/Issue1388Test.php @@ -0,0 +1,49 @@ + + + + + + + + + + +
+ + + + + + + +
+
+EOF; + + $builder = new QuickBuilder(); + $builder->setSchema($schema); + $builder->buildClasses(null, true); + } +} \ No newline at end of file