Having a tough time getting Flask-migrate to detect new column in a table. My guess is that something isn't getting imported, or I'm importing things in the incorrect order.
The app is instantiated by a __init__.py
file. The overall directory of the app is structured as such:
|-static/
|-templates/
|__init__.py
|filters.py
|models.py
|forms.py
|utils.py
|views.py
The relevant part of the __init__.py
file looks like this:
# Import flask and template operators
from flask import Flask, render_template, Blueprint
import os
# Import SQLAlchemy
from flask_sqlalchemy import SQLAlchemy
from flask_migrate import Migrate
from flask_uploads import UploadSet, configure_uploads
from flask_mail import Mail
# Define the WSGI application object
app = Flask(__name__)
# Configurations
app.config.from_pyfile(os.path.join('..','config.py'))
# Define the database object which is imported
# by modules and controllers
db = SQLAlchemy(app)
from . import models
migrate = Migrate(app, db,compare_type=True)
mail = Mail(app)
In the command line I set export FLASK_APP=<app_name>
I make the change to the models.py
file, adding a new column to one of my tables.
Then I run the command flask db migrate
However the only output I get from the above command is:
INFO [alembic.runtime.migration] Context impl SQLiteImpl.
INFO [alembic.runtime.migration] Will assume non-transactional DDL.
And there is no new migration script added to the versions
directory of the migrations
folder. This has worked in the past and I'm not sure why it's no longer working.