cakephp / phinx

PHP Database Migrations for Everyone
https://phinx.org
MIT License
4.45k stars 895 forks source link

Option for addTimeStamps() to use datetime #2273

Closed joshbmarshall closed 2 months ago

joshbmarshall commented 3 months ago

Adds a feature flag to use datetime on MySQL for addTimestamps() function instead of timestamp.

Implements #1635

timestamp columns do not support dates past 2038-01-19 on MySQL

dereuromark commented 3 months ago

@cakephp/phinx Any reviews?

dereuromark commented 3 months ago

Will this be ported to migrations? I wonder if we should make a list of prs to migrate etc

markstory commented 3 months ago

Will this be ported to migrations? I wonder if we should make a list of prs to migrate etc

In a way yes, I'm hoping to update the internals of migrations to use cake's db reflection so we'll inherit the fix made in cake. I can also port this change as is over it should apply.

joshbmarshall commented 2 months ago

I had considered requesting to make it the default since timestamp fields are deprecated in MySQL. But didn't want to add delays to getting the option into the code so I can start using it ;)

It should definitely become the default on the next major revision of phinx if it has to wait until then.