开发者

Symfony - Form Generation failure: Cannot fetch TableMap for undefined table

开发者 https://www.devze.com 2023-02-22 03:11 出处:网络
This is a curious issue.I\'ve had a project up and running for a while, this only started when I added one new table to the schema.

This is a curious issue. I've had a project up and running for a while, this only started when I added one new table to the schema.

These are the relevant schema descriptions. Each table exsists and matches:

  comment:
    id:
    message:         longvarchar
    quote_id:
    reply_id:        { type: integer, foreignTable: comment, foreignReference: id}
    created_by:      { type: integer, foreignTable: sf_guard_user, foreignReference: id, onDelete: setnull }
    created_at:
    updated_at:

  quote:
    id:
    account_number:
    customer_name:
    ...
    created_at:
    updated_at:         

  contract
    id:
    account_number:  varchar(32)
    customer_name:   varchar(64)
    ...
    created_at:
    updated_at:

  contract_comment:
    id:
    contract_id:
    comment_id:

When I run ./symfony propel:build --all, it builds the model classes, and starts to build the form classes, then it errors out saying:

Cannot fetch TableMap for undefined table: comment

However, it's abundantly cle开发者_如何学JAVAar that the table does exist. If I remove the contract_comment entry from the schema, and rebuild, the comments work fine.

I looked up the other users who ran into this error here, but none of their solutions apply to my situation.


Have you tried re-naming the comment table to something else? I had similar problems with a table named "project" because apparently that is a special word in Propel (?) when trying to build everything. Renaming it to jump_project or whatever solved the problem.


I just came across this problem myself.

The solution was to update the composer autoloader to include the new table classes/bases/maps.

0

精彩评论

暂无评论...
验证码 换一张
取 消