Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

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.



2.3k
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.