We're setting up a multi tenant website using Yii2. We want to allow each user to have it's own database while using the same system. We'll also have a system database that holds the users information and information like invoicing.
Here are some of our questions.
- How do we make the second database connection (db2) dynamic, based on information stored in the first database connection (db)?
- How do we setup migrations to be applied to all tenant databases (db2) while they are dynamic?
- How would we target one dynamic database on initial migration?
There are a few links that have helped but haven't answered all our questions.
Multiple database connections and Yii 2.0
http://www.yiiframework.com/doc-2.0/guide-db-migrations.html