I am developing a system for a school. It consists of some modules (3-5 modules) that is each developed in separate yii project. I am developing the second module now. I found out that some tables are duplicates from the first module. In order to reduce the maintenance, is that possible to use same tables? Hence, updating a table from first module will be reflected on the second module.
I am thinking of using multiple connection to the database. I will have one database to store only master tables. While module specific tables will be stored on the other database.
While, it is not a best practice, I am not really care if the code (model/view/controller) should be copy paste from one module to another. Best, if it is in one place, for the sake of maintenance.
What I mean by module is not the yii module, but more to development phase and different location of the deployed server. Master tables will stay together with the module for educational. However, there will be finance module that deployed on dfferent server but must use master table on the educational server.
My master tables, like students, units and subjects need to be consistent, mean changes made by the operator from one module say finance department need to be seen by the educational department and vice versa.
I like your idea, but I do not want to use the createCommands. I prefer to use CActiveRecord. Is that possible? How to differentiate that a model need to use db or masterDb connection?