Skip to content

Conversation

@MasterOdin
Copy link
Member

@MasterOdin MasterOdin commented Nov 17, 2025

Closes #1891

This is a port of cakephp/migrations#923 with some additional changes.

PR improves the behavior of how we handle the string "CURRENT_TIMESTAMP" as a default such that it will now only not be quote if the column type is explicitly datetime, timestamp, date, or time. This should make behavior across adapters consistent where for mysql using CURRENT_TIMESTAMP with a string column would throw an error while postgres would implicitly cast it to a string.

I've also added similar behavior to the CURRENT_DATETIME, CURRENT_TIME, CURRENT_DATE, and NOW functions since those are also somewhat common in my experience as defaults for datetime, time, and date respectfully.

Co-authored-by: Mark Scherer <[email protected]>

Signed-off-by: Matthew Peveler <[email protected]>
@MasterOdin MasterOdin merged commit 508a0c8 into 0.x Nov 17, 2025
12 checks passed
@MasterOdin MasterOdin deleted the fix-datetime-default branch November 17, 2025 20:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CURRENT_TIMESTAMP not quoted even for non-datetime columns

2 participants