This article originally appear Old Model in the germany phone number library Diff Agency blog and has been publish here with permission.
Rirect the old model to the new tables. With the exception of the model we are actively deprecating, our goal is to leave the entirety of the codebase untouch. Any references to the old model and methods still work exactly as they us to, they just secretly interact with a new database structure.
Migrate the data. After this deployment, the old database table is no longer us in any way.
This first deployment contains
more risk than subsequent ones, so we made sure to be extra careful about testing exhaustively and discussing any potential issues early on. We us a combination of existing unit tests, new unit tests, manual testing, as well as GUI automation tests.
This step ensures that the existing model, OldModel, can still be us safely in any code that we haven’t had the chance to refactor yet. In order to do so, we ne to heavily modify the class so that it exposes the exact same API as it us to, while in reality utilizing the new database structure.
First we ne to make the old model
communicate with the new what will you do with artificial intelligence? database table. This one is easy:
Next, we deal with any attribute ao lists that have been renam using alias, allowing us to continue using them as if nothing had chang.