mirror of
https://github.com/bigchaindb/bigchaindb.git
synced 2024-10-13 13:34:05 +00:00
Use as the argument name for for clarity
This commit is contained in:
parent
ad65e86131
commit
b51a59e503
@ -58,15 +58,15 @@ def drop_database(connection, dbname):
|
||||
raise NotImplementedError
|
||||
|
||||
|
||||
def init_database(conn=None, dbname=None):
|
||||
def init_database(connection=None, dbname=None):
|
||||
"""Initialize the configured backend for use with BigchainDB.
|
||||
|
||||
Creates a database with :attr:`dbname` with any required tables
|
||||
and supporting indexes.
|
||||
|
||||
Args:
|
||||
conn (:class:`~bigchaindb.backend.connection.Connection`): an existing
|
||||
connection to use to initialize the database.
|
||||
connection (:class:`~bigchaindb.backend.connection.Connection`): an
|
||||
existing connection to use to initialize the database.
|
||||
Creates one if not given.
|
||||
dbname (str): the name of the database to create.
|
||||
Defaults to the database name given in the BigchainDB
|
||||
@ -77,9 +77,9 @@ def init_database(conn=None, dbname=None):
|
||||
given :attr:`dbname` already exists as a database.
|
||||
"""
|
||||
|
||||
conn = conn or connect()
|
||||
connection = connection or connect()
|
||||
dbname = dbname or bigchaindb.config['database']['name']
|
||||
|
||||
create_database(conn, dbname)
|
||||
create_tables(conn, dbname)
|
||||
create_indexes(conn, dbname)
|
||||
create_database(connection, dbname)
|
||||
create_tables(connection, dbname)
|
||||
create_indexes(connection, dbname)
|
||||
|
@ -138,7 +138,7 @@ def _run_init():
|
||||
# Try to access the keypair, throws an exception if it does not exist
|
||||
b = bigchaindb.Bigchain()
|
||||
|
||||
schema.init_database(b.connection)
|
||||
schema.init_database(connection=b.connection)
|
||||
|
||||
logger.info('Create genesis block.')
|
||||
b.create_genesis_block()
|
||||
|
Loading…
x
Reference in New Issue
Block a user