名称为“controlling_tool.customer_group_text”的表已存在

时间:2013-04-23 07:53:51

标签: php codeigniter doctrine

我正在使用DOCTRINE2CodeIgniter 2。我对此很新。 我试图从实体生成mysqltables,我总是得到这个错误 [Doctrine\DBAL\Schema\SchemaException]
名称为“controlling_tool.customer_group_text”的表已存在 我没有2个项目使用相同的实体。 数据库是空的即使我尝试删除它,这个过程也不行。 你能解释一下吗

namespace Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * Entity\CustomerGroupText
 *
 * @Entity(repositoryClass="CustomerGroupTextRepository")
 * @Table(name="customer_group_text", indexes={@Index(name="fk_status_idx", columns={"customer_group_id"}), @Index(name="fk_language_idx", columns={"language_id"})})
 */
class CustomerGroupText
{
    /**
     * @Id
     * @Column(type="string", length=5)
     */
    protected $customer_group_id;

    /**
     * @Column(type="string", length=45, nullable=true)
     */
    protected $description;

    /**
     * @ManyToOne(targetEntity="CustomerGroup", inversedBy="customerGroupTexts")
     * @JoinColumn(name="customer_group_id", referencedColumnName="id", nullable=false)
     */
    protected $customerGroup;

    /**
     * @ManyToOne(targetEntity="Language", inversedBy="customerGroupTexts")
     * @JoinColumn(name="language_id", referencedColumnName="id_language_id", nullable=false)
     */
    protected $language;

    public function __construct()
    {
    }

    /**
     * Set the value of customer_group_id.
     *
     * @param string $customer_group_id
     * @return Entity\CustomerGroupText
     */
    public function setCustomerGroupId($customer_group_id)
    {
        $this->customer_group_id = $customer_group_id;

        return $this;
    }

    /**
     * Get the value of customer_group_id.
     *
     * @return string
     */
    public function getCustomerGroupId()
    {
        return $this->customer_group_id;
    }

    /**
     * Set the value of description.
     *
     * @param string $description
     * @return Entity\CustomerGroupText
     */
    public function setDescription($description)
    {
        $this->description = $description;

        return $this;
    }

    /**
     * Get the value of description.
     *
     * @return string
     */
    public function getDescription()
    {
        return $this->description;
    }

    /**
     * Set CustomerGroup entity (many to one).
     *
     * @param Entity\CustomerGroup $customerGroup
     * @return Entity\CustomerGroupText
     */
    public function setCustomerGroup(CustomerGroup $customerGroup = null)
    {
        $this->customerGroup = $customerGroup;

        return $this;
    }

    /**
     * Get CustomerGroup entity (many to one).
     *
     * @return Entity\CustomerGroup
     */
    public function getCustomerGroup()
    {
        return $this->customerGroup;
    }

    /**
     * Set Language entity (many to one).
     *
     * @param Entity\Language $language
     * @return Entity\CustomerGroupText
     */
    public function setLanguage(Language $language = null)
    {
        $this->language = $language;

        return $this;
    }

    /**
     * Get Language entity (many to one).
     *
     * @return Entity\Language
     */
    public function getLanguage()
    {
        return $this->language;
    }

    public function __sleep()
    {
        return array('customer_group_id', 'language_id', 'description');
    }
}

1 个答案:

答案 0 :(得分:0)

尝试清除codeigniter项目缓存。我认为它正试图从那里读取配置细节。