How to run migrations

Overview

Listed beloe are the commands you can use to run the migrations from scratch

Common Commands

Initialise migrations (first time only):

flask db init

Generate a new migration after changing models.py:

flask db migrate -m "message/changes you made"

Apply migrations to the database:

flask db upgrade

Roll back the last migration:

flask db downgrade

Roll back all migrations to a blank database:

flask db downgrade base