flask migrate multiple heads

from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from flask_migrate import Migrate

app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///example.db'
db = SQLAlchemy(app)
migrate = Migrate(app, db)
  1. Import necessary modules (Flask, SQLAlchemy, Migrate) from Flask and related extensions.
  2. Create a Flask application instance.
  3. Set the database URI for SQLAlchemy to use (in this case, SQLite is used with a file named example.db).
  4. Initialize the SQLAlchemy object (db) by passing the Flask application instance.
  5. Create a migration engine (migrate) by passing the Flask application instance and SQLAlchemy object (db) to the Migrate class.