Under Symfony 5.0, I use generic entity classes to unify internal projects. My generic entity (e.g. Table) looks like this:
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass="App\Repository\TableRepository")
* @ORM\InheritanceType("SINGLE_TABLE")
* @ORM\DiscriminatorMap({"generic_table": "App\Entity\Generic\Table", "table": "App\Entity\Table"})
*/
class Site
{
//protected properties and public methods
}
And inherited class:
use App\Entity\Generic\Table as GenericTable;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass="App\Repository\TableRepository")
*/
class Table extends GenericTable
{
//private properties and public methods
}
However, when executing this command:
php bin/console make:migration
It returns the following:
Table mybd.table already exists.
Even if the table doesn't.
Any idea? Have I forgotten an ORM statement?