我使用以下命令创建了一个名为Comment的新实体: php app / console doctrine:generate:entity
我在Comment.php文件中更改了它的名字,如下所示:
/**
* Comment
*
* @ORM\Table(name="blog_comment")
* @ORM\Entity(repositoryClass="Mysite\BlogBundle\Entity\CommentRepository")
*/
class Comment
{
/**
* @ORM\ManyToOne(targetEntity="Mysite\BlogBundle\Entity\Article")
* @ORM\JoinColumn(nullable=false)
*/
private $article;
当我尝试命令 php app / console doctrine:schema:update --dump-sql 时,它会返回“CREATE TABLE Comment ...”。所以它忽略了我的变化?
我刚刚清除缓存并再次尝试,没有任何变化......任何想法?
答案 0 :(得分:1)
如果您使用app/console cache:clear
,我建议您尝试使用rm -rf app/cache/*
,看看是否能解决您的问题。我偶尔遇到这个问题,这通常有效。