Bug #30223

Column names for association properties are generated wrong

Added by Karsten Dambekalns almost 4 years ago. Updated almost 4 years ago.

Status:Resolved Start date:2011-09-23
Priority:Must have Due date:
Assigned To:Karsten Dambekalns % Done:

100%

Category:Persistence
Target version:TYPO3 Flow Base Distribution - 1.0.0
PHP Version: Complexity:
Has patch: Affected Flow version:

Description

As discovered by Bastian, column names for associations are created in model tables not with the property name but the name that is to be used for join tables.

Examle:

/**
 * @var \TYPO3\FLOW3\Resource\Resource
 */
 protected $foo;

would create a column named flow3_resource_resource instead of the expected foo.


Related issues

duplicated by TYPO3.Flow - Bug #29982: Wrong table structure for multiple ManyToOne relations Resolved 2011-09-18

Associated revisions

Revision 395997de
Added by Karsten Dambekalns almost 4 years ago

[!!!][BUGFIX] Fix column names for association properties

For associations without a join table the column names in the
model tables followed the target type, not the property name as
it was intended (flow3_resource_resourcepointer instead of
resourcepointer).

This is a breaking change, as it requires database changes. For
the framework packages migrations are included, for custom code
generating a migration (or using update) is needed.

Change-Id: Ia32cfcc6cd49385a61845243e67cb0ddd62f5268
Fixes: #30223

History

#1 Updated by Karsten Dambekalns almost 4 years ago

  • Subject changed from column names for association properties are generated wrong to Column names for association properties are generated wrong

#2 Updated by Karsten Dambekalns almost 4 years ago

  • % Done changed from 0 to 90

The issue is fixed, the fix will be pushed for review as soon as I have the needed migrations ready.

#3 Updated by Mr. Hudson almost 4 years ago

  • Status changed from Accepted to Under Review

Patch set 1 of change Ia32cfcc6cd49385a61845243e67cb0ddd62f5268 has been pushed to the review server.
It is available at http://review.typo3.org/5291

#4 Updated by Mr. Hudson almost 4 years ago

Patch set 2 of change Ia32cfcc6cd49385a61845243e67cb0ddd62f5268 has been pushed to the review server.
It is available at http://review.typo3.org/5291

#5 Updated by Mr. Hudson almost 4 years ago

Patch set 3 of change Ia32cfcc6cd49385a61845243e67cb0ddd62f5268 has been pushed to the review server.
It is available at http://review.typo3.org/5291

#6 Updated by Karsten Dambekalns almost 4 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 90 to 100

#7 Updated by Bastian Waidelich almost 4 years ago

Hint for developers that come across this and need to upgrade their packages:
It is not possible for Doctrine to detect that change automatically, it will drop the previous table and create a new one instead (AFAIK).
You can solve this by fixing the migration that is generated by ./flow3 doctrine:migrationgenerate manually. See http://git.typo3.org/FLOW3/Packages/FLOW3.git?a=commit;h=395997deae0c4230636276d0c2c0bf7a22d6fcc1 for an example

Also available in: Atom PDF