We are moving our forum in GitHub Discussions. For questions about Phalcon v3/v4 you can visit here and for Phalcon v5 here.

Phalcon migration does not support all of MySQL's data types

I've been using the migration developer tool for some time now and have never had an issue until now. Upon further inspection I noticed that the problem extended beyond this to cover all but the 7 data types that the migration tool supports.

I had a field in the data based with the data type TIMESTAMP so that I could assign it the default value of CURRENT_TIMESTAMP. I generated the migration, uploaded it to my server online and imported it. When working with the field I noticed that the times were off by about 9 hours (9:00 AM at the time), which was odd since offline tests showed everything working correctly.

So off I went to check the servers date. Date was good. Then I decided to check the table's values and that is where I spotted that only the date part was being saved and the time was nowhere to be seen. Inspecting the structure showed that the field was labled as DATE and not TIMESTAMP. I ran the migration again just to obtain the same result.

Basically, all my TIMESTAMP fields were changed to DATE and all my ENUM fields were changed to CHAR.

Are there plans to provied support for all of MySQL's data types? Phalcon\Db\Column shows support for only 10 data types when MySQL has easily over 20.

Thanks for the feedback.

Hi. I have same problem too with ENUM datatype.

Phalcon team, TIMESTAMP and ENUM is strictly needed... Is there any temporary workaround to deal with?

Yes, please. What is the workaround? I need DOUBLE, ENUM and TIMESTAMP in particular.

edited Jun '15

Same here. I need TIME type but it does not exists. I solved it setting 'type' => 'TIME' (as string) on the migration files, after generating it.


Yes please. Same error here

Same here. especially double.