I’m creating a bundle for Symfony 2 that has two user types. Only one user type will be used (the class is specified in the services configuration). I have defined two User classes that inherit from a common base class (using single table inheritance). However, the discriminator column seems like a waste of space to me. Is there a way to inherit from the base class without using STI?
If I leave out the InheritanceTypeannotation, the Symfony console command doctrine:update:schema tries to create the user table twice and throws an error.
The inheritance model depends on the discriminator column to work. You can’t leave it out.
It’s not a waste of space. You trade a little space for more reliable and performant ORM.