代码之家  ›  专栏  ›  技术社区  ›  mattalxndr

尝试从条令模型生成表并得到MySQL错误

  •  0
  • mattalxndr  · 技术社区  · 16 年前

    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

    我认为这是因为它看到了模型中定义的关系并试图创建约束。但是他们正在处理的表还没有被创建。我的假设正确吗?

    有什么我能修的吗?

    1 回复  |  直到 15 年前
        1
  •  0
  •   mattalxndr    13 年前

    在我追查了这个错误的根源之后,我意识到罪魁祸首是一个不“体贴”的行为模板。

    推荐文章