Hi,

I am a new dev using just release 2.0.4 archive.
I get the following error while trying to create a schema from entity
described with annotations :

 $ ./console doctrine:schema:create --dump-sql
Catchable Fatal Error: Argument 1 passed to Doctrine\DBAL\Schema
\Table::addIndex() must be an array, string given, called in /home/
apache/vendor/doctrine/lib/Doctrine/ORM/Tools/SchemaTool.php on line
220 and defined in /home/apache/vendor/doctrine-dbal/lib/Doctrine/DBAL/
Schema/Table.php line 151

It seems to be related to my User entity defining Indexes :

/**
 * @ORM\Table(
 *   name="user",
 *   uniqueConstraints={
 *     @ORM\UniqueConstraint(name="user_unique_id", columns={"id"}),
 *     @ORM\UniqueConstraint(name="user_unique_username",
columns={"username"}),
 *     @ORM\UniqueConstraint(name="user_unique_email",
columns={"email"})
 *   },
 *   indexes={
 *     @ORM\Index(name="user_index_username", columns="username"),
 *     @ORM\Index(name="user_index_email", columns="email")
 *   }
 * )
 * @ORM\Entity(repositoryClass="Job\SeekerBundle\Repository
\UserRepository")
 */
class User implements AdvancedUserInterface, \Serializable
{
...
}

Looking at vendor/doctrine/lib/Doctrine/ORM/Tools/SchemaTool.php on
line 220:

            if (isset($class->table['indexes'])) {
                foreach ($class->table['indexes'] AS $indexName =>
$indexData) {
                    $table->addIndex($indexData['columns'],
$indexName);
                }
            }

and vendor/doctrine-dbal/lib/Doctrine/DBAL/Schema/Table.php line 151:

    public function addIndex(array $columnNames, $indexName = null)

The error stack is consistent.

Is this a know error ? Am I doing something wrong ?
Any help/hint appreciated !

Thanks !

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-devs?hl=en

Reply via email to