mastodon-BDSM/BDSM/commands.py

16 lines
329 B
Python
Raw Normal View History

2022-09-18 05:23:33 +02:00
#!/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.')