この php app/console doctrine:schema:update --force を使用してデータベースを更新すると、以下に示す例外が発生します MappingException: Duplicate definition of column 'email' on entity 'Dashboard\UserBundle\Entity\User' in a fieldまたは、user.php の識別列マッピングを以下に示します
<?php
// src/Dashboard/UserBundle/Entity/User.php
namespace Dashboard\UserBundle\Entity;
use FOS\UserBundle\Entity\User as BaseUser;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints AS Assert;
use Dashboard\UserBundle\Entity\User;
/**
* @ORM\Entity
* @ORM\Table(name="acme_user")
* @ORM\AttributeOverrides({
* @ORM\AttributeOverride(name="email", column=@ORM\Column(type="string", name="email", length=255, unique=false, nullable=true)),
* @ORM\AttributeOverride(name="emailCanonical", column=@ORM\Column(type="string", name="email_canonical", length=255, unique=false, nullable=true))
* })
*/
class User extends BaseUser
{
/**
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
/**
* @ORM\Column(type="string", length=255)
* @Assert\NotBlank()
* @Assert\Email()
*/
protected $email;
/**
* @ORM\Column(type="string", length=255)
* @Assert\NotBlank()
*/
protected $Password;
public function getId()
{
return $this->id;
}
public function getEmail()
{
return $this->email;
}
public function setEmail($email)
{
$this->email = $email;
}
public function getPassword()
{
return $this->plainPassword;
}
public function setPassword($password)
{
$this->plainPassword = $password;
}
public function __construct()
{
parent::__construct();
// your own logic
}
}
この例外を削除するには?