Can a Discriminator Column be part of the Primary Key in Doctrine2?

woulsessy

New Member
I'm using Single Table Inheritance in Doctrine2 to store OAuth credentials for multiple services. I'd like to use the service's id as the primary key; however, that's not unique across all services. I've setup the database to use the discriminator column and the service's id as the primary key, but I can't find a way to make Doctrine use the discriminator column as the key (in addition to the discriminator column). I'm using docblock annotations, and if I add the discriminator column as an @Id field I get an error:\[code\]Duplicate definition of column...in a field or discriminator column mapping.\[/code\]If I only define the field as the discriminator column, any overlapping service ids update all the matching rows.Anyway to make this work, other than just using an autogenerated it value?
 
Back
Top