Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migration on Multiple Database migration #1483

Closed
aksharaCaprice opened this issue Jan 21, 2019 · 5 comments
Closed

Migration on Multiple Database migration #1483

aksharaCaprice opened this issue Jan 21, 2019 · 5 comments

Comments

@aksharaCaprice
Copy link

How to do migration on multiple databases from a single environment ?
eg: below given are multiple database name
customer1_application
customer2_application
customer3_application
customer4_application
How to run same migration in all databases ?

@lorenzo
Copy link
Member

lorenzo commented Jan 23, 2019

Have many different configuration files, and run sphinx pointing it to each different configuration

@aksharaCaprice
Copy link
Author

In my scenario I have 100's of databases it is difficult to run 100 migrations separately . From table I can get all the database name is there any other solution to do migrations in all databases by running single migration.

@broberts-dev
Copy link

This use case is contemplated by #180

@lorenzo
Copy link
Member

lorenzo commented Jan 25, 2019

@aksharaCaprice care to explain what the difficult part would be? You could even point to the same config file but pass different environment variables. The config files supports that. You just need to call sphinx in a loop for each database. That's the logic phinx would have to do anyway

@suryacaprice
Copy link

Hi @lorenzo
I work with akshara . Sorry for the late reply . Our product is a multitenant application. Ex : Customer 1 --> customer 1 db , Customer 2 ---> customer 2 db .. this is exponential increase and the db name changes dynamically as the customer base grows. Is there a way to handle it ? Do you have any scripts to handle the dynamic database name change in phinx . Without which we cant use the phinx into our application . I am sure many products use the same concept

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants