Applying database migration with Flask-Migrate
The significant third-party Flask module to use when building an application is a module that will manage the data model layer, and that is the Flask-Migrate extension. Although it is sometimes appropriate to customize database migration using Alembic, Flask-Migrate offers easy setup and configuration with less coding and fast results.
Important note
Alembic is a lightweight and fast database migration tool for SQLAlchemy that can be customized to support various database backends.
Database migration is a way of deriving and generating the database schema from the Flask model classes and allowing the changes to be monitored and audited in these schemas throughout the application’s lifespan, such as adding and dropping table columns, modifying table constraints, and renaming columns without ruining the current data. All these mechanisms are managed by Flask-Migrate.
Now, let’s understand how to set up a database...