问题
INFO [alembic.runtime.migration] Context impl MySQLImpl.
INFO [alembic.runtime.migration] Will assume non-transactional DDL.
INFO [alembic.env] No changes in schema detected.
解决
将models文件导入,就可以识别
from gevent import monkey;monkey.patch_all()
from web import create_app, db , models
from flask_script import Manager
from flask_migrate import Migrate, MigrateCommand
app = create_app()
manager = Manager(app)
Migrate(app=app, db=db)
manager.add_command('db', MigrateCommand)
@manager.command
def runserver_gevent():
from gevent import pywsgi
server = pywsgi.WSGIServer(("127.0.0.1", 5000), app)
server.serve_forever()
if __name__ == '__main__':
manager.run()
重新迁移
删掉迁移文件再次迁移
python manage.py db init
python manage.py db migrate
python manage.py db upgrade
|