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

I needed to first clear the cache with

php bin/console doctrine:cache:clear-metadata 

Success!


You should add the annotation @Entity to the entity to be recognized as an entity in doctrine ORM.

<?php

/**
 * Customer
 *
 * @ORM\Table(name="customers")
 * @ORM\Entity(repositoryClass="YourBundle/Repository/YourRepositoryName")
 */
class Customer{

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

}

You can also use this command to auto-generate entities with different required annotations:

bin/console doctrine:generate:entity

This can also happened when your mapping is invalid.

A quick workaround would be to do

php bin/console doctrine:schema:validate

Then fix errors until you see

[OK] The mapping files are correct.

Now make php bin/console doctrine:migrations:diff again and it should work.