1

I'm trying to set up a project using Doctrine 2.3.2 on a database-first implementation. after generating the xml and the mappings, then calling orm:validate-schema it shows me that the mapping is right but the database validation fails. In using the schema tool to find out where my issues I'm finding 2 issues are repeating over and over:

  1. change all my varchars that aren't already at 255 to varchar(255)
  2. drop my primary key with for example the columns (A, B, C) and then create a new primary key with the same columns in a different order (B, A, C)

Both of these things seem meaningless to change. Why would Doctrine force me to change my schema in ways that seem meaningless?

The solution to both of these without changing the database schema is:

  1. the convert-mapping doesn't appear to add the length property to the id field - add it to the xml
  2. This appears to be caused by a difference between the order of the columns in the table, and the order of the columns in the Primary Key. Re-order the order of the xml entries to match the order of the Primary Key.

Having to 2 #1 I'm assuming is a bug - which I will report soon. However, is #2 above a bug or does changing the order mess with Doctrine's logic in some way?

3
  • The order of columns in any index matters. Especially in a primary key. The order of columns in a table doesn't matter.
    – zerkms
    Feb 6, 2013 at 9:12
  • But as it relates to an ORM like Doctrine? It's griping at me because the order of columns doesn't match the order in the primary key. If I change either - it stops griping.
    – McAden
    Feb 6, 2013 at 17:43
  • This is an issue, not a support request. Please consider opening an issue on doctrine-project.org/jira with a reproducible example.
    – Ocramius
    Feb 9, 2013 at 16:51

1 Answer 1

0

The more I think about this the more I believe it to be an oversight and not done intentionally. I was thinking there was something I was missing but I think these are issues with the library and have added them doctrine's JIRA.

EDIT: Links per request

1
  • Can you provide a link to the issue you've opened?
    – Ocramius
    Feb 14, 2013 at 2:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.