Bug #26482
Must specify table name with unique constraints and indexes with Doctrine 2
Status: | Resolved | Start date: | 2011-04-29 | |
---|---|---|---|---|
Priority: | Should have | Due date: | ||
Assigned To: | Karsten Dambekalns | % Done: | 100% |
|
Category: | Persistence | |||
Target version: | TYPO3 Flow Base Distribution - 1.0 beta 1 | |||
PHP Version: | Complexity: | |||
Has patch: | Affected Flow version: |
Description
If a unique-constraint or an additional index is needed for a table/object, the Doctrine 2 ORM has the possiblity to do this with a special annotation in the head of the class as shown in the following example:
@table(uniqueConstraints={@UniqueConstraint(name="klasse_unique",columns={"klasse"})})
If the full table name is not given in the annotation, like in the example above, the Doctrine 2 ORM generates a table which has exactly the name of the class. This collides with the new table-naming schema which normally names table like <package>_<subfolder of Domain\Model folder - if existing>_<classname>.
If you fully qualify the @table annotation like shown below it works fine.
@table(name="welupdm_stammdaten_klasse", uniqueConstraints={@UniqueConstraint(name="klasse_unique",columns={"klasse"})})
It should not be necessary to furnish the fully qualified table-name unless explicitly wanted or needed.
Associated revisions
[BUGFIX] Make table name in @Table annotation optional
When using the @Table Doctrine annotation to specify unique constraints
or indexes one had to specify the table name, although maybe not needed.
Fixes: #26482
Change-Id: I3515ad0247f5495254f19dfcdf11b3aa27cdf704
History
#1 Updated by Karsten Dambekalns over 4 years ago
- Category set to Persistence
- Status changed from New to Accepted
- Assigned To set to Karsten Dambekalns
- Target version set to 1.0 beta 1
#2 Updated by Karsten Dambekalns over 4 years ago
- Tracker changed from Feature to Bug
#3 Updated by Mr. Hudson over 4 years ago
Patch set 1 of change I3515ad0247f5495254f19dfcdf11b3aa27cdf704 has been pushed to the review server.
It is available at http://review.typo3.org/1796
#4 Updated by Karsten Dambekalns over 4 years ago
- Subject changed from Unique Constraints and Indexes with Doctrine 2 to Must specify table name with unique constraints and indexes with Doctrine 2
- Status changed from Accepted to Under Review
#5 Updated by Karsten Dambekalns about 4 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 364c6d41c499f3e3d1f6d81012651bbfa568819f.