propelorm/Propel

Which version of Propel 1.6.7+ is introducing lower case for column name in *Map class?

Opened this issue · 1 comments

gedeh commented

Hi,

Thank you for maintaining Propel 1.* branch for so long, very much appreciated it! You guys doing an excellent work!

This is more of a question rather than issue. Recently I tried to help my friend to upgrade his good old Symfony 1.4 project which uses sfPropelORMPlugin to latest dependencies. When I reach to the stage of upgrading sfPropelORMPlugin, the tests start to failing.

I see the cause is in the project it uses Criteria and addSelectColumn(SamplePeer::SAMPLE_COLUMN_NAME); extensively to perform various select query which it can't be done using the OOTB query object.

After a $item = BasePeer::doSelect($criteria)->fetch(); is executed, it iterates the result and use capital case as the column name such as $item['SAMPLE_COLUMN_NAME'];. After upgrade to latest Propel, these kind of codes needs to be changed to $item['sample_column_name']; instead.

Then I looked into sfPropelORMPlugin changes and see it recently changed its Propel dependency from 1.6.7 to 1.7.1.

Can you let me know which version of Propel between 1.6.7 and 1.7.1 is actually change the behaviour of base objects (*Map, *Peer, and Base*) creation that now it use lower case instead of the previous capital case?

For example in generated SampleTableMap.php, it becomes

$this->addColumn('sample_column_name', 'SampleColumnName', 'VARCHAR', true, 100, null);

which previously it was

$this->addColumn('SAMPLE_COLUMN_NAME', 'SampleColumnName', 'VARCHAR', true, 100, null);

If its the case, then probably no harm to specify that that specific version is no longer backward compatible, or is there a suggestion how the Criteria and BasePeer::doSelect($criteria) should be used to avoid this?

Thanks!

gedeh commented

Seems I found this commit which causes the issue:
a2ff295 - Fix case sensitivity

which resolved issue #496 - [Postgresql ] dev-master broken - case sensitive problem

Is the BC break is intentional?