Skip to content

Create Flask database migrations

You can create migrations for your database using flask-migrate.

First, you need to initialize the migrations using the following command in your main project directory, after you have setup your database:

flask db init

Now you can create a new migration:

flask db migrate -m "<migration name>"

To update the database to the new version:

flask db upgrade
Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.