Database Migration in SQLAlchemy Database migration is basically keeping any changes you want to make to your database into code and the code that undo the changes you made. This will help you to revert changes you made to the database anytime you want and more over if you have testing and production environment deploying database changes into production is done by just running a script.