我想在兩個表添加一個一對多的雙向關聯:課程和認證學說更新不會做任何事情
已經有一個一對多的關係,但單向的。
所以我修改了兩個實體,使其雙向和增加對當然側財產
這裏有兩個實體:
/**
* 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' –
它不工作,要麼 –