mastodon-BDSM/BDSM/commands.py
2022-09-18 11:23:33 +08:00

15 lines
329 B
Python

#!/usr/bin/env python3
import click
from BDSM import app, db
from BDSM.models import Settings
@app.cli.command()
@click.option('--drop', is_flag=True, help='Create after drop.')
def initdb(drop):
"""Initialize the database."""
if drop:
db.drop_all()
db.create_all()
click.echo('Initialized database.')