If I have an entity class that uses a trait which declares entity relations, those entity relations will be ignored by the php app/console doctrine:migrations:diff
command.
I assume it is the same with the Symfony command php app/console doctrine:schema:update --force
.
For example:
trait FooTrait {
/**
* @ORM\OneToOne(targetEntity="AnotherEntity")
* @ORM\JoinColumn(name="fk_another")
*
* @var AnotherEntity
*/
private $another;
}
/**
* @ORM\Entity
*/
public class Bar {
use FooTrait;
/**
* @var string *
* @ORM\Column(type="string")
*/
private $name;
}
Will generate a migration that creates field fk_another as VARCHAR(255)
without any indices.