mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
DDC-966: SchemaTool does not check for inherited fields in STI sub-classes and overwrites their column definitions to DEFAULT NULL #1206
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @doctrinebot on GitHub (Jan 1, 2011).
Originally assigned to: @beberlei on GitHub.
Jira issue originally created by user ayhan:
Expected SQL-dump:
SQL-dump created by SchemaTool:
This behaviour is problematic, especially for columns which are part of a unique constraint.
Reason:
SchemaTool doesn't really check for inherited fields in STI sub classes in method getSchemaFromMetadata() and passes all fields (incl. the inherited) to method _gatherColumn() where finally the column definition of the parent class will be overwritten.
A quick fix:
Change that if-clause above to
Better fix:
Only pass not inherited fields to the _gatherColumn() method, as done with CTI sub classes.
@doctrinebot commented on GitHub (Jan 2, 2011):
Comment created by @beberlei:
Fixed
@doctrinebot commented on GitHub (Jan 2, 2011):
Issue was closed with resolution "Fixed"
@doctrinebot commented on GitHub (Jan 2, 2011):
Comment created by ayhan:
Wow, that was fast!