Search code examples
phpsymfonydoctrine-ormdoctrine

doctrine:migrations:diff give "No changes detected in your mapping information"


I'm using doctrine in combination with symfony. For the database setup I'm using annotations. I created a table successfully but gave the wrong format integer for a field city which I need to change to string. My understanding was, that when I'm changing the annotations in the customers class from

class Customer{

  /**
   * @ORM\Column(type="integer", nullable=true)
   * @var string city
   */
  private $city;

}

to

class Customer{

  /**
   * @ORM\Column(nullable=true)
   * @var string city
   */
  private $city;

}

and then run

php bin/console doctrine:migrations:diff

all changes of the mapping should be recognized and a php file should be generated containing an ALTER TABLE query or similar. However, this command replies with a "No changes detected in your mapping information". What am I missing?


Solution

  • I needed to first clear the cache with

    php bin/console doctrine:cache:clear-metadata 
    

    Success!