在Symfony 5.0下,我使用通用实体类来统一内部项目。我的通用实体(例如表格)如下所示:
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
}
和继承类:
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
}
但是,执行此命令时:
php bin/console make:migration
它返回以下内容:
Table mybd.table already exists.
即使桌子没有。
任何想法?我忘记了 ORM 语句吗?