@click.group()<EOL>@click.option('<STR_LIT>', default=None, help='<STR_LIT>')<EOL>@click.option('<STR_LIT>', default=None, help='<STR_LIT>',<EOL>type=click.Path(exists=True))<EOL>@click.option('<STR_LIT>', default=None, help='<STR_LIT>')<EOL>@click.option('<STR_LIT>', default=None,<EOL>help='<STR_LIT>', type=click.File('<STR_LIT:rb>'))<EOL>@click.pass_context<EOL>def snaql_migration(ctx, db_uri, migrations, app, config):
if config:<EOL><INDENT>migrations_config = _parse_config(config)<EOL><DEDENT>else:<EOL><INDENT>if db_uri and migrations and app:<EOL><INDENT>migrations_config = _generate_config(db_uri, migrations, app)<EOL><DEDENT>else:<EOL><INDENT>raise click.ClickException('<STR_LIT>')<EOL><DEDENT><DEDENT>ctx.obj = {<EOL>'<STR_LIT>': migrations_config<EOL>}<EOL>try:<EOL><INDENT>ctx.obj['<STR_LIT>'] = DBWrapper(ctx.obj['<STR_LIT>']['<STR_LIT>'])<EOL><DEDENT>except Exception as e:<EOL><INDENT>raise click.ClickException('<STR_LIT>'.format(str(e)))<EOL><DEDENT>
Lightweight SQL Schema migration tool based on Snaql queries