anyx / LoginGateBundle

59 stars 23 forks source link

Use LoginGateBundle when using multiple database connection in symfony project #19

Closed niravkukadiya89 closed 2 years ago

niravkukadiya89 commented 4 years ago

Hello,

I am using symfony 4 and in my project I have multiple (Two) database connection. Example DB1 and DB2

  1. DB1 is third party database or we can say its another project database.
  2. DB2 is my current symfony4 project database.

We have users and for the validate user we have make DB1 as default database. So when i run migration It will create tables (Login Gate Bundle Tables) in the DB1 as its defined as default database.

But my question is How to run migration which will create table in DB2 ? is there any configuration ?

Dr-Ash commented 4 years ago

Hello @niravkukadiya89

Any new on this?

anyx commented 4 years ago

Hi everyone! I think, for this need to manually register bundle's entities mapping and override entity_manager for this service: https://github.com/anyx/LoginGateBundle/blob/master/Resources/config/services.orm.yml#L6.

I never works with multiple database connections, but I think it's a pretty common solution for this case. Please, let me know if I can help