Bug #26482

Must specify table name with unique constraints and indexes with Doctrine 2

Added by Regine Rosewich over 10 years ago. Updated over 10 years ago.

Status:
Resolved
Priority:
Should have
Category:
Persistence
Start date:
2011-04-29
Due date:
% Done:

100%

Estimated time:
PHP Version:
Has patch:
Complexity:

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.

#1

Updated by Karsten Dambekalns over 10 years ago

  • Category set to Persistence
  • Status changed from New to Accepted
  • Assignee set to Karsten Dambekalns
  • Target version set to 1.0 beta 1
#2

Updated by Karsten Dambekalns over 10 years ago

  • Tracker changed from Feature to Bug
#3

Updated by Mr. Hudson over 10 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 10 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 over 10 years ago

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

Also available in: Atom PDF