symfony 2创建多租户数据库

I have a multitenants project that requires me to use Symfony 2.

I have followed this tutorial with success. I have 2 Entity managers. 1 for the global tenant database and another for each tenant's DB connection. It is dynamically updating the connection to use different DB with every different subdomain.

I am now stuck in how to create new DB and new DB User when there is a registration. My questions are:

  1. What is the best Symfony way to achieve this?
  2. What is the best workflow so I can update every single tenants' DB everytime there is structure update?

Thanks!