def reset_db():
if prompt_bool(
'Are you sure you want to lose all your data for {0}'.format(
app.config['SQLALCHEMY_DATABASE_URI'].split('@')[1])
):
from alembic.command import downgrade, upgrade
from alembic.config import Config as AlembicConfig
config = AlembicConfig('alembic.ini')
downgrade(config, 'base')
upgrade(config, 'head')
print('Database has been reset')
评论列表
文章目录