Migrate multiple databases with Propel

156 views Asked by At

I am maintaining a system with many databases. One “central" db, and many other “client” dbs. Each time a client registers, we create a client db using an SQL file. The system is using Propel + PHP + MySQL.

Now the problem is, there are changes when we do version-up. It’s possible to use Propel migration for central db, but there are MANY client dbs, and in propel.yaml/ propel-config.php we only have ONE connection string for client like this:

$manager = new \Propel\Runtime\Connection\ConnectionManagerSingle();
$manager->setConfiguration(array(
    'classname' => 'Propel\\Runtime\\Connection\\ConnectionWrapper',
    'dsn' => 'mysql:host=127.0.0.1;dbname=' . $shopDbName . ';charset=UTF8',
    'user' => 'dba',
    'password' => ‘******',
    'attributes' =>
        array(
            'ATTR_EMULATE_PREPARES' => false,
        ),
));

in which $shopDbName is the global variable identified by a string sent from client devices.

So, how can I automate the process of migration for client dbs in this case, please?

0

There are 0 answers