Skip to content

cake bake model should be more robust #1059

@nook24

Description

@nook24

Description

The new association alias FlowNodes is already set exception can break the baking of models. In my case, my table has two columns flow_node_id and flow_node_parent_id. Both are unrelated to CakePHP. How ever, it is not possible to bake a Model for this, because the bake command already throws the exception.

I dropped one column to resolve the issue, passing --no-associations would be another option, but I think the bake command should be less strict. It is expected that the auto generated code could contain potential errors and the exception should occoure on runtime, but not on generating the php code itself.

I think this behavior got implemented with CakePHP 5.1:

Adding associations with duplicate names will now raise exceptions.

CakePHP Version

5.2.8

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions