Reputation: 69
Currently I know the issue of Flask and I want to migrate to FastAPI because the asynchronous issue is possible in the response of the api, but I have been looking and I have not found the equivalent of flask-migrate
in FastAPI.
flask-migrate
is mainly responsible for catching the models already established in our app and if a column is added to the new model, only flask db migrate and flask db upgrade should be used and that what it does is update the ddl of the table that is in the database, but I cannot find the equivalence in FastAPI .
This is the link to migrate with flask-migrate
:
https://j2logo.com/tutorial-flask-leccion-11-update-data-base-sqlalchemy/
Upvotes: 5
Views: 11282
Reputation: 175
As @MathLindh mentioned, flask-migrate
is just an abstraction of alembic
migrations. You can do the same with FastAPI by integrating alembic
. You can refer to the below link for info:
https://fastapi.tiangolo.com/tutorial/sql-databases/#migrations
Upvotes: 0