Skip to content

Introspect default expressions as DefaultExpression#7275

Merged
morozov merged 1 commit into
doctrine:4.4.xfrom
morozov:issues/7274
Jan 18, 2026
Merged

Introspect default expressions as DefaultExpression#7275
morozov merged 1 commit into
doctrine:4.4.xfrom
morozov:issues/7274

Conversation

@morozov

@morozov morozov commented Jan 17, 2026

Copy link
Copy Markdown
Member

Fixes #7274.

This is a backport of the corresponding logic from #7197.

The idea is that AbstractSchemaManager implementations should not invoke AbstractPlatform::getCurrent*SQL(), the return value of which would match the expression string and trigger a deprecation. Instead, they should instantiate the corresponding DefaultExpression instance.

I haven't found an existing test where I could put a "no deprecation triggered" assertion, and I don't feel like writing a throwaway one. This is how the the changes can be formally verified:

➜ git grep -- '->getCurrent.*SQL' 4.4.x src/Schema/**/*SchemaManager.php
4.4.x:src/Schema/MySQLSchemaManager.php:            'current_timestamp()' => $platform->getCurrentTimestampSQL(),
4.4.x:src/Schema/MySQLSchemaManager.php:            'curdate()' => $platform->getCurrentDateSQL(),
4.4.x:src/Schema/MySQLSchemaManager.php:            'curtime()' => $platform->getCurrentTimeSQL(),
4.4.x:src/Schema/SQLServerSchemaManager.php:            return $this->platform->getCurrentTimestampSQL();

➜ git grep -- '->getCurrent.*SQL' HEAD src/Schema/**/*SchemaManager.php || echo Not found
Not found

@morozov

morozov commented Jan 18, 2026

Copy link
Copy Markdown
Member Author

The test failures are being fixed in #7276.

@morozov morozov marked this pull request as draft January 18, 2026 07:46
@morozov morozov marked this pull request as ready for review January 18, 2026 16:22
@morozov morozov requested a review from greg0ire January 18, 2026 16:27
@morozov morozov merged commit 21241d2 into doctrine:4.4.x Jan 18, 2026
136 checks passed
@morozov morozov deleted the issues/7274 branch January 18, 2026 19:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Deprecation Message for CURRENT_TIMESTAMP

2 participants