user2094540
user2094540

Reputation:

Symfony2 : doctrine orm ignore if I change table name

I made a new Entity called Comment using the command : php app/console doctrine:generate:entity

I changed its name in the Comment.php file like this :

/**
 * 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;

When I try the command php app/console doctrine:schema:update --dump-sql, it returns me "CREATE TABLE Comment ...". So it ignores my changes ?

I just cleared cache and tried again, nothing changes... Any idea ?

Upvotes: 2

Views: 2842

Answers (1)

Ken Hannel
Ken Hannel

Reputation: 2748

If you used app/console cache:clear I would recommend trying rm -rf app/cache/* instead and see if that fixes your issue. I run into this problem occasionally and this usually works.

Upvotes: 2

Related Questions