#!/usr/bin/env python

"""Create the initial database structure.

Existing tables will be ignored, and those not existing will be created.

:Copyright: 2006-2018 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""

import click

from byceps.database import db
from byceps.util.system import get_config_filename_from_env_or_exit

from bootstrap.util import app_context


@click.command()
def execute():
    click.echo('Creating database ... ', nl=False)

    db.create_all()

    click.secho('done.', fg='green')


if __name__ == '__main__':
    config_filename = get_config_filename_from_env_or_exit()
    with app_context(config_filename):
        execute()

Add script to create initial database structure
Add script to create initial database structure
