我最近有机会雇佣了一个类,这个类来自用户herit,由于加密密码,我做了如下更改:
$employe = new Employe();
$form = $this->createForm(EmployeType::class, $employe);
$form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid())
{
$employe->setUsername($form->get("email")->getData());
$employe->getUtilisateur()->setPassword(
$passwordEncoder->encodePassword(
$employe,
$form->get('utilisateur')['password']->getData()
)
这使我成为一个编译错误来修复,它在我的实体中我现在从用户扩展employe
class Employe extends User
但我知道我有以下错误:
执行'select t0.username as username\u 1,t0.username\u canonical as username\u canonical\u 2,t0.email as email\u 3,t0.email\u canonical as email\u canonical\u 4,t0.enabled as enabled\u 5,t0.salt as salt\u 6,t0.password as password\u 7,t0.last\u login as last\u login\u 8,t0.confirmation\u token as confirmation\u token\u 9'时发生异常,t0.password\u requested\u at as password\u requested\u at\u 10,t0.roles as roles\u 11,t0.id as id\u 12,t0.nom as nom\u 13,t0.prenom as prenom\u 14,t0.telephone as telephone\u 15,t0.fax as fax\u 16,t0.is active as\u active\u 17,t0.date\u first\u login as date\u first\u login\u 18,t0.role as role\u 19,t0.portable\u pro as portable\u pro 20,t21.username as username\u 22,t21.username\u canonical as username\u canonical\u 23,t21.email as email\u 24,t21.email\u canonical as email\u canonical\u 25,t21.enabled as enabled\u 26,t21.salt as salt\u 27,t21.password as password\u 28,t21.last\u login as last\u login\u 29,t21.confirmation\u token as confirmation\u token\u 30,t21.password\u requested\u as password\u requested\u 31,t21.roles as roles\u 32,t21.id as id\u 33,t21.nom as nom\u 34,t21.prenom as prenom\u 35,t21.telephone as telephone\u 36,t21.fax as fax\u 37,t21.is\u active as\u active\u 38,t21.date\u first\u login as date\u first\u login\u 39,t21.role as role\u 40,t21.portable\u pro as portable\u pro\u 41,t21.usaliateur\u id as usaliateur\u id\u 42,t21.agence\u id as agence\u id\u 43,t0.USILIATEUR\ U id as USILIATEUR\ U id\ U 45,t0.AGENTE\ U id as AGENTE\ U id\ U 46从雇员t0向左加入雇员t21。USILIATEUR\ U id=t44.id':
sqlstate[42s22]:找不到列:“on子句”中的1054未知列“t44.id”
你知道怎么修吗?
1条答案
按热度按时间o3imoua41#
对实体的更改导致表结构的更改。应用程序中的条令现在使用更新的元数据,并认为数据库有一个结构,但您的数据库没有自动更新,而是有另一个结构。
要同步数据库结构,您需要:
为运行脚本的数据库生成迁移(diff):
运行此迁移: