migration to flask-sqlalchemy (II)