DDC-3381: orm:schema-tool:update shows incorrect changes with MasterSlaveConnection wrapper class #4177

Open
opened 2026-01-22 14:36:45 +01:00 by admin · 2 comments
Owner

Originally created by @doctrinebot on GitHub (Nov 9, 2014).

Originally assigned to: @beberlei on GitHub.

Jira issue originally created by user pietervogelaar:

My entities and database are in sync. If I use the default Doctrine connection configuration it shows "Nothing to update - your database is already in sync with the current entity metadata.". This is what I would expect and is correct.

'doctrine' => array(
        'connection' => array(
            'orm_default' => array(
                'driverClass' => 'Doctrine\DBAL\Driver\PDOMySql\Driver',
                'params' => array(
                    'host'     => 'localhost',
                    'port'     => '3306',
                    'user'     => 'myuser',
                    'password' => 'mypassword',
                    'dbname'   => 'example',
                    'charset'  => 'utf8',
                ),
        ),
),

But with the MasterSlaveConnection configuration, I always get the same changes which are a lot, you would think the database is empty at the moment.

'doctrine' => array(
        'connection' => array(
            'orm_default' => array(
                'wrapperClass' => 'Doctrine\DBAL\Connections\MasterSlaveConnection',
                'params' => array(
                    'driver' => 'pdo_mysql',
                    'master' => array(
                        'host' => 'localhost',
                        'port' => '3306',
                        'user' => 'myuser',
                        'password' => 'mypassword',
                        'dbname' => 'example',
                        'charset' => 'utf8',
                    ),
                    'slaves' => array(
                        array(
                            'host' => 'localhost',
                            'port' => '3306',
                            'user' => 'myuser',
                            'password' => 'mypassword',
                            'dbname' => 'example',
                            'charset' => 'utf8',
                        ),
                    ),
                ),
            ),
        ),
    ),
),
Originally created by @doctrinebot on GitHub (Nov 9, 2014). Originally assigned to: @beberlei on GitHub. Jira issue originally created by user pietervogelaar: My entities and database are in sync. If I use the default Doctrine connection configuration it shows "Nothing to update - your database is already in sync with the current entity metadata.". This is what I would expect and is correct. ``` 'doctrine' => array( 'connection' => array( 'orm_default' => array( 'driverClass' => 'Doctrine\DBAL\Driver\PDOMySql\Driver', 'params' => array( 'host' => 'localhost', 'port' => '3306', 'user' => 'myuser', 'password' => 'mypassword', 'dbname' => 'example', 'charset' => 'utf8', ), ), ), ``` But with the MasterSlaveConnection configuration, I always get the same changes which are a lot, you would think the database is empty at the moment. ``` 'doctrine' => array( 'connection' => array( 'orm_default' => array( 'wrapperClass' => 'Doctrine\DBAL\Connections\MasterSlaveConnection', 'params' => array( 'driver' => 'pdo_mysql', 'master' => array( 'host' => 'localhost', 'port' => '3306', 'user' => 'myuser', 'password' => 'mypassword', 'dbname' => 'example', 'charset' => 'utf8', ), 'slaves' => array( array( 'host' => 'localhost', 'port' => '3306', 'user' => 'myuser', 'password' => 'mypassword', 'dbname' => 'example', 'charset' => 'utf8', ), ), ), ), ), ), ), ```
admin added the Bug label 2026-01-22 14:36:45 +01:00
Author
Owner

@doctrinebot commented on GitHub (Nov 10, 2014):

Comment created by @ocramius:

Can you come up with a functional test case for this? Couldn't reproduce from here.

@doctrinebot commented on GitHub (Nov 10, 2014): Comment created by @ocramius: Can you come up with a functional test case for this? Couldn't reproduce from here.
Author
Owner

@doctrinebot commented on GitHub (May 28, 2015):

Comment created by cartel_denniss:

Hello, I'm on a Symfony 2.6.6 project and I encountered the same problems. Although:

shell> php app/console doctrine:cache:clear-metadata

.. did the trick for me!

@doctrinebot commented on GitHub (May 28, 2015): Comment created by cartel_denniss: Hello, I'm on a Symfony 2.6.6 project and I encountered the same problems. Although: shell> php app/console doctrine:cache:clear-metadata .. did the trick for me!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#4177