请求Doctrine 2未知列类型

时间:2012-02-29 21:45:42

标签: symfony doctrine-orm

我正在尝试使用以下命令更新我的学说模式:

php app/console doctrine:schema:update --force

我收到了这个错误:

[Doctrine\DBAL\DBALException]
Unknown column type  requested.

我收到此错误,因为我更新了Sonata UserBundle中用户实体的xml映射,如下所示:

<?xml version="1.0" encoding="UTF-8"?>
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping"
              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
              xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping
              http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd">

    <entity name="Application\Sonata\UserBundle\Entity\User" table="fos_user_user" repository-class="Application\Sonata\UserBundle\Repository\UserRepository">

        <id name="id" column="id" type="integer">
            <generator strategy="AUTO" />
        </id>

        <field name="name" type="string" length="50" />
        <field name="birthdate" type="date" />
        <field name="natRanking" type="string" length="10" />
        <field name="interNatRanking" type="string" length="10" nullable="true" />
        <field name="natDoublesRanking" type="string" length="10" />
        <field name="interNatDoublesRanking" type="string" length="10" nullable="true" />
        <field name="doublesPartner" type="string" length="50" nullable="true" />
        <field name="nationality" type="string" length="50" />
        <field name="fileName" type="string" length="255" nullable="true" />
        <field name="path" type="string" length="255" nullable="true" />
        <field name="file" />

        <many-to-many field="teams" target-entity="Tennisconnect\DashboardBundle\Entity\Team" mapped-by="players">
        <join-table name="team_user">
            <join-columns>
                <join-column name="team_id" referenced-column-name="id"/>
            </join-columns>
            <inverse-join-columns>
                <join-column name="user_id" referenced-column-name="id"/>
            </inverse-join-columns>
        </join-table>
        </many-to-many>

        <one-to-many field="my_friends" target-entity="Friend" mapped-by="friends_of_mine" />
        <one-to-many field="friended_me" target-entity="Friend" mapped-by="friends_with_me" />

    </entity>

1 个答案:

答案 0 :(得分:3)

字段“文件”的类型是否丢失?