if not,there will be an error:
Column 'xxxx' doesn't make part of the column map
i can't find any information to solve this problem
if not,there will be an error:
Column 'xxxx' doesn't make part of the column map
i can't find any information to solve this problem
Sajan
On
Phalcon comes with devtools which is a great command line tool to automate tasks like creating models and controllers. I'd recommend that you install this and generate model using command like phalcon model MODELNAME. Otherwise, you will have to manually change the model names in the columnmap located in the model class.
Copyright © 2021 Jogjafile Inc.
You have two options:
You can update array with column map in method
columnMap()to include changes in database table column names.You can remove the method
columnMap()from Model class - this will disable checking if columns exist in database table, allowing You to ignore newly added fields. Changes to existing table columns can break existing code.If You have control over the database schema, then use the first method, as this will prevent errors like only some of the database queries not working. Otherwise use the second method.
Here is a helpful link to Phalcon documentation on column mapping.