system-pri/backend/app/commands/clear_db.py

13 lines
222 B
Python
Raw Normal View History

from flask.cli import with_appcontext
from click import command
from ..dependencies import db
@command('clear_db')
@with_appcontext
def clear_db() -> None:
"""Clear database"""
db.drop_all()
db.create_all()