summaryrefslogtreecommitdiff
path: root/check/commands/phash/drop.py
blob: 40a8261d1f5cc6981e92f6e38d5085e700611fb8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
"""
Drop the database (useful when testing)
"""

import click
import glob

from app.models.sql_factory import Base, engine

@click.command()
@click.option('-f', '--force', 'opt_force', is_flag=True,
  help='Actually drop the database')
@click.pass_context
def cli(ctx, opt_force):
  """
  Drop the database
  """
  if opt_force:
    print('Dropping the database...!')
    Base.metadata.drop_all(engine)
  else:
    print('Will foolishly drop the database if the --force flag is passed')