Php Symfony 2 create database命令失败,出现架构异常消息
您好: 我有一个symfony2db,它工作得很好,然后不得不对该DB进行一些更改,我删除了其中一个实体,并添加了另一个实体。我没有找到再次更新数据库的方法,所以我手动删除了所有表,希望再次创建它。更新模式命令不起作用;我收到以下错误:Php Symfony 2 create database命令失败,出现架构异常消息,php,mysql,symfony,Php,Mysql,Symfony,您好: 我有一个symfony2db,它工作得很好,然后不得不对该DB进行一些更改,我删除了其中一个实体,并添加了另一个实体。我没有找到再次更新数据库的方法,所以我手动删除了所有表,希望再次创建它。更新模式命令不起作用;我收到以下错误: ...# php app/console doctrine:database:create Created database for connection named `eregistry` ...# php app/console doctrine:gener
...# php app/console doctrine:database:create
Created database for connection named `eregistry`
...# php app/console doctrine:generate:entities Eregistry
Generating entities for namespace "Eregistry"
> backing up Fields.php to Fields.php~
> generating Eregistry\EventBundle\Entity\Fields
> backing up FieldEvent.php to FieldEvent.php~
> generating Eregistry\EventBundle\Entity\FieldEvent
> backing up Participant.php to Participant.php~
> generating Eregistry\EventBundle\Entity\Participant
> backing up Event.php to Event.php~
> generating Eregistry\EventBundle\Entity\Event
> backing up Modality.php to Modality.php~
> generating Eregistry\EventBundle\Entity\Modality
> backing up Person.php to Person.php~
> generating Eregistry\EventBundle\Entity\Person
> backing up Domain.php to Domain.php~
> generating Eregistry\EventBundle\Entity\Domain
> backing up FieldData.php to FieldData.php~
> generating Eregistry\EventBundle\Entity\FieldData
...# php app/console doctrine:schema:update --force
[Doctrine\DBAL\Schema\SchemaException]
The table with name 'eregistry.event' already exists.
doctrine:schema:update [--complete] [--dump-sql] [--force] [--em[="..."]]
...#
数据库是新创建的,为什么它会给我一个异常,说表已经存在?
这个问题的原因可能是什么?
当做
Abel您确定您的新实体与另一个实体没有相同的表名吗?新类称为participant,错误中甚至没有提到它,提到的一个是event,event是在执行更新模式时应该创建的第一个类,我的意思是,甚至没有尝试对新类做任何事情。我认为这个错误与其他事情有关。