phpmodelphalconphalcon-orm

phalcon models must be modified with mysql columns' changes at the same time


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


Solution

  • You have two options:

    1. You can update array with column map in method columnMap() to include changes in database table column names.

    2. 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.