We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

how to use the developer tools about commands create-model

in the document about "Developer Tools", when use the "phalcon model products" can auto generate the model file. usually some buiness logic methods about operater the database will place in the same model file. however , sometimes, database structure will change, after that, should I need to run the "create-model" commands again? the self-define method can be keep or not?

thanks.



3.8k
Accepted
answer

Hi, yes you should run the command again !

Fortunatly, the phalcon dev-tools can open and parse your classes, this will NOT delete your custom changes, and will add the new properties.

You might want to check the definitions of relationship.

Only if you don't know yet.... There's a way to create all models phalcon all-models.

If the models already exists you should add the flag --force -> phalcon all-models --force, this also works with phalcon model

Hope it helps.