我正在尝试删除数据库中的表,但是我收到以下错误:
AttributeError: 'SQLAlchemy' object has no attribute '_run_visitor'
如何删除Flask-SQLAlchemy模型的表?
db = SQLAlchemy(app)
class DeleteTable(Resource):
def get(self):
CardsDB.__table__.drop(db)
class CardsDB(db.Model):
__tablename__ = 'Cards'
id = db.Column(db.Integer, primary_key=True)
viewID = db.Column(db.Integer, db.ForeignKey('Views.id'))
api.add_resource(DeleteTable,'/user/delete/table')