I want to implement the Class Table Inheritance:
/**
* Foo
*
* @ORM\Table(name="foos", ...)
* @ORM\Entity
* @ORM\InheritanceType("JOINED")
* @ORM\DiscriminatorColumn(name="type", type="string")
* @ORM\DiscriminatorMap({
* "bar" = "Bar",
* "buz" = "Buz"
* })
*/
abstract class Foo
{
...
}
Since I run the "code first" approach, the database is generated by Doctrine:
$ bin/console doctrine:migrations:diff
$ bin/console doctrine:migrations:migrate
The discriminator column foos.type
gets the type VARCHAR(255)
. I want it to get an ENUM
instead.
How to define the annotation for the entity class for getting an ENUM
discriminator?