blob: aee922d05cc114e9c5ed510aab6a0ba0ed5179d8 (
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 not opt_force:
print('Will foolishly drop the database only if the --force flag is passed')
else:
print('Dropping the database...!')
Base.metadata.drop_all(engine)
|