0

Doctrine_Core::createTablesFromModels() 失败并出现以下错误:

  1. Fatal error: Uncaught exception 'Doctrine_Connection_Mysql_Exception' with message 'SQLSTATE[42S02]: Base table or view not found: 1146 Table 'newmexicocreates.address_type' doesn't exist. Failing Query: "SELECT a.id AS a__id, a.title AS a__title FROM address_type a"' in /[removed]/lib/doctrine/Doctrine/Connection.php:1082
  2. Stack trace:
  3. #0 /[removed]/lib/doctrine/Doctrine/Connection.php(1025): Doctrine_Connection->rethrowException(Object(PDOException), Object(Doctrine_Connection_Mysql), 'SELECT a.id...')
  4. #1 /[removed]/lib/doctrine/Doctrine/Query/Abstract.php(976): Doctrine_Connection->execute('SELECT a.id...', Array)
  5. #2 /[removed]/lib/doctrine/Doctrine/Query/Abstract.php(1026): Doctrine_Query_Abstract->_execute(Array)
  6. #3 /[removed]/app/models/behaviors/IdAsConstant.php(16): Doctrine_Query_Abstract->execute()
  7. #4 /[removed]/ in /[removed]/lib/doctrine/Doctrine/Connection.php on line 1082

我认为这种情况正在发生,因为它看到了模型中定义的关系并试图创建约束。但他们正在处理的表尚未创建。我在这个假设中正确吗?

有什么我可以尝试解决的吗?

4

1 回答 1

0

在我追查到这个错误的根源后,我意识到罪魁祸首是一个没有被“体谅”的行为模板。

具体来说,该行为假设该表在执行其 setUp 方法时存在。

于 2010-08-22T07:08:48.340 回答