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

MySql BIT(1) field and its Model representation - strange problem

On Windows machine we have table with TINYINT(1) 'domain' fields, and it's represented in model as string values "1" or "0". We moved application to different machine with Ubuntu. Used phalcon migration run to generate tables. Surprisingly this field was created as BIT(1) on Ubuntu, which is not realy a problem, but values in model are not proper anymore. vardump($this->domain) returns ["domain":protected]=> string(1) ""

What can be a reason for this ?

Definition of this field in migration file is: new Column( 'domain', array( 'type' => Column::TYPE _ BOOLEAN, 'notNull' => true, 'size' => 1, 'after' => 'phone' ) ), While searching for solution I changed type to BIT(1) on Windows machine, but it still works fine there. Also changed type to TINYINT(1) on Ubuntu, and it started to work, but we can't use migration tools. We have phalcon 2.0.4 on Ubuntu. We have had 2.0.3 on Windows, but upgraded it imediatelly. Can it be somwhere in MySql configuration or phalcon configuration ?

It looks like a bug, can you please post this on Github? https://github.com/phalcon/cphalcon/issues

It looks like a bug, can you please post this on Github? https://github.com/phalcon/cphalcon/issues

I posted an issue there. I can cooperate to fix this bug if it's possible because it's machine dependant.