"is it possible to reference a column other than 'id' for a joincolumn?" Answer’s


I think Doctrine wants these to be primary keys, from the docs:

name: Column name that holds the foreign key identifier for this relation.

Another thing that jumps out at me from your code sample is category.id2 being type string, I would at least expect it to be an integer, but it may also need to be for @JoinColumn to work properly.

You may be able to get away with just @Index on category.id2 and leave it as a string though; worth a shot anyway.

Wednesday, March 31, 2021
answered 10 Months ago
Only authorized users can answer the question. Please sign in first, or register a free account.
Not the answer you're looking for? Browse other questions tagged :