def init(ctx):
"""Initializes the database."""
db = ctx.obj.db
db_url = db.url
# Check if the database already exists
if is_sqlitedb_url(db_url) and sqlitedb_present(db_url):
raise click.UsageError("Refusing to overwrite database "
"at {}".format(db_url))
db.reset()
# -------------------------------------------------------------------------
# User commands
评论列表
文章目录