me/commands/db.py
def rebuild(ctx):
    """ Completely rebuilds test db. Can only be used with --test-mode flag
    """
    if not config.test_mode:
        return fail('rebuild may only be used in test mode! Aborting.')
    write('Rebuilding test database')
    updater = sql.DbUpdater(config.main_db, config.migrations_dir)
    engine = updater.db.engines['migration']
    user = engine.url.username
    database = engine.url.database

    # Begin calls

    res = call(['dropdb', database, '-U', user])
    if res:
        return fail('Drop db operation failed!')
    res = call(['createdb', database, '-E', 'utf8', '-l', 'en_US.utf8',
                '-T', 'template0', '-U', user])
    if res:
        return fail('createdb operation failed!')
    write('Test database {} rebuilt successfully'.format(database))
    ctx.invoke(grant)
 Completely rebuilds test db. Can only be used with --test-mode flag
    
Completely rebuilds test db. Can only be used with --test-mode flag
Completely rebuilds test db . Can only be used with -- test - mode flag
def rebuild(ctx):
    if not config.test_mode:
        return fail('rebuild may only be used in test mode! Aborting.')
    write('Rebuilding test database')
    updater = sql.DbUpdater(config.main_db, config.migrations_dir)
    engine = updater.db.engines['migration']
    user = engine.url.username
    database = engine.url.database
    res = call(['dropdb', database, '-U', user])
    if res:
        return fail('Drop db operation failed!')
    res = call(['createdb', database, '-E', 'utf8', '-l', 'en_US.utf8',
                '-T', 'template0', '-U', user])
    if res:
        return fail('createdb operation failed!')
    write('Test database {} rebuilt successfully'.format(database))
    ctx.invoke(grant)
def rebuild ( ctx ) : if not config . test_mode : return fail ( 'rebuild may only be used in test mode! Aborting.' ) write ( 'Rebuilding test database' ) updater = sql . DbUpdater ( config . main_db , config . migrations_dir ) engine = updater . db . engines [ 'migration' ] user = engine . url . username database = engine . url . database res = call ( [ 'dropdb' , database , '-U' , user ] ) if res : return fail ( 'Drop db operation failed!' ) res = call ( [ 'createdb' , database , '-E' , 'utf8' , '-l' , 'en_US.utf8' , '-T' , 'template0' , '-U' , user ] ) if res : return fail ( 'createdb operation failed!' ) write ( 'Test database {} rebuilt successfully' . format ( database ) ) ctx . invoke ( grant )
Completely rebuilds test db.
Completely rebuilds test db .
""" Completely rebuilds test db. Can only be used with --test-mode flag
    """ # Begin calls
ctx