Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.0.13
-
Fix Version/s: 1.2.0-BETA1
-
Component/s: Import/Export
-
Labels:None
-
Environment:Doctrine 1.1 from current SVN with PostgreSQL 8.3.8
Description
If a PostgreSQL table has a composite primary key, Doctrine import ("generate-models-db") will only mark the first column of the composite key as primary. This is due to a bug in Doctrine_Import_Pgsql.
I have attached a short patch against the current 1.1 branch (revision 6580). The version 1.2 seems to have the same problem.
I have tested the patch with PostgreSQL 8.3.8.
Small test case for this bug:
Database schema:
This is a typical many-to-many relationship with a mapping table.
Note that testa_testb has a composite primary key with two columns, testa and testb.
Generated code before applying the patch (generateModelsFromDb):
Generated code after applying the patch: