dev1234 dev1234 - 1 year ago 115
SQL Question

Yiic migration for multiple database

Is it possible to run Yiic migrate create command for multiple databases ?

I have a Multi-Tenant Data Architecture, one source code and multiple database for client. each client will use same source code and but a separate database.

Ex., will have two database but points to same source code.

So i just want to know is there any possibility to use Yiic migration for multiple databases ?

What is SAAS (Multi-Tenant)

Answer Source

You can configure more than one connection on your protected/config/console.php

Then, when running the migration, specify the connection id

/yiic migrate --connectionID=db         # The default
/yiic migrate --connectionID=andrew     # connection andrew
/yiic migrate --connectionID=client3    # connection client3