0

We have ported the YII Migrations to our application. But sadly due to lack of knowledge / missing req. we are stuck on how to manage migrations between multiple instances of the same database.

Our structure is based on the same database which has different data in it. While all databases have separate MySQL connection instances and are exactly the same.

The problem we are having is that we need the structural migrations to affect all databases but the data migrations to be applied only to given DB.

Any suggestions how to achieve that?

My idea was that I create an migration instance per database, but I have no means to tell the single migrations apart. I was thinking to use global vars for it, but yuck. Any other ideas?

2
  • Could you provide more information on your situation? or some example? to better understand your application and the goal you try to accomplish. If you have multiple applications with different databases and want to apply a data, not structure, migration, I guess you could add some condition inside of the migration and first check the database name so it only runs on the one you want? Aug 23, 2015 at 22:55
  • We have a zend 2 like structure with dynamical modules wich are saparated and have a base structure wich they share (the structure of the DB) but they all have their data wich they need do port with them when they are installed/uninstalled. For that i am intending to use migrations as instalation tool. Hope that clarifies the situation :) I will add conditions and namespaces for the migrations i think...
    – Sangoku
    Aug 24, 2015 at 5:17

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.