Open nook24 opened 10 months ago
Hi, Will this bug be corrected ? It's not wasy to migrate to CakePhp5 for big applications, but we need to run tests that need migrations and that contain some queries ?
@mcube27 No it won't. If you don't want to see deprecations you can turn them off. But you'll need to address the deprecations before you can upgrade.
Upgrading migrations may also help as currently migrations is not using newQuery()
anywhere.
We use migration sometimes to make sql queries using $this->getQueryBuilder()
.
That is why I asked if it will be corrected ?
After attempting to fix this with #731, I don't think there is a reasonable solution for this deprecation warning. Phinx providers the getQueryBuilder()
method. All of phinx's branches have moved past compatibility with cakephp 4.x making releasing new patch builds more complicated.
If you want to get rid of the deprecations now you'd have to alter your usage of migrations to
$query = $this->adapter->getDecoratedConnection()->selectQuery();
Thanks for the update. We have scheduled the migration to CakePHP 5 for the end of this year. I guess to replace the old getQueryBuilder()
calls should not be to hard.
The changes from your PR are a good reference guess. https://github.com/cakephp/migrations/pull/731/files
Is there any documentation about getDecoratedConnection()
available?
Is there any documentation about getDecoratedConnection() available?
No, but it will return a Cake\Database\Connection
with the connection that migrations are being run on. That method will be available in both 4.x and 5.x compatible migrations once #732 is merged.
Perfect, many thanks
This is a (multiple allowed):
[x] bug
[ ] enhancement
[ ] feature-discussion (RFC)
CakePHP Version: 4.5.0
Migrations plugin version: 3.9.0
@stable in composer.json
Bake plugin version (if relevant): EXACT RELEASE VERSION OR COMMIT HASH, HERE.
Database server mysql Ver 8.0.34-0ubuntu0.22.04.1
PHP Version: PHP 8.1.2-1ubuntu2.14
Platform / OS: Ubuntu and RHEL
What you did
When using CakePHP 4.5.0 with the migration plugin, I get the following deprecated messages
This is
/opt/openitc/frontend/config/Seeds/InstallSeed.php, line 153
:Expected Behavior
No deprecated messages