我想在两个表添加一个一对多的双向关联:课程和认证学说更新不会做任何事情
已经有一个一对多的关系,但单向的。
所以我修改了两个实体,使其双向和增加对当然侧财产
这里有两个实体:
/**
* Course
*
* @ORM\Table()
* @ORM\Entity(repositoryClass="ME\ExamsBundle\Entity\CourseRepository")
*/
class Course
{
/**
* @ORM\OneToMany(targetEntity="ME\ExamsBundle\Entity\Certified", mappedBy="course")
* @ORM\JoinColumn(nullable=true)
*/
private $certified;
//getters and setters...
}
/**
* Certified
*
* @ORM\Table()
* @ORM\Entity(repositoryClass="ME\ExamsBundle\Entity\CertifiedRepository")
*/
class Certified
{
/**
* @ORM\ManyToOne(targetEntity="ME\ExamsBundle\Entity\Course", inversedBy="certified")
* @ORM\JoinColumn(nullable=false)
*/
private $course;
// getters and setters...
}
但是当我使用命令
doctrine:schema:update -- dump-sql
它告诉我没有什么可更新的。
我试图
明确的元数据CACH
除去两侧可空
删除数据库并重新创建它
但物业认证从未出现在数据库中的课程表中。
我有点卡在这里,所以任何帮助将不胜感激。
在此先感谢
汤姆
尝试'学说:架构:更新--force' –
它不工作,要么 –