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

13 lines
222 B
Python

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