mattyh88
mattyh88

Reputation: 1645

Doctrine 2 unknown column type requested

I'm trying to update my doctrine schema with the command:

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

I'm getting this error:

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

I'm getting this error since I've updated the xml mapping of the user entity in the Sonata UserBundle like this:

<?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>

Upvotes: 0

Views: 3541

Answers (1)

ma cılay
ma cılay

Reputation: 739

Is the type of the field "file" missing?

Upvotes: 3

Related Questions