diff --git a/bigchaindb/backend/localmongodb/schema.py b/bigchaindb/backend/localmongodb/schema.py index 4d13658a..25ef7f4e 100644 --- a/bigchaindb/backend/localmongodb/schema.py +++ b/bigchaindb/backend/localmongodb/schema.py @@ -31,8 +31,7 @@ def create_database(conn, dbname): @register_schema(LocalMongoDBConnection) def create_tables(conn, dbname): - for table_name in ['transactions', 'utxos', 'assets', 'blocks', 'metadata', - 'validators', 'pre_commit']: + for table_name in backend.schema.TABLES: logger.info('Create `%s` table.', table_name) # create the table # TODO: read and write concerns can be declared here diff --git a/bigchaindb/backend/query.py b/bigchaindb/backend/query.py index 7527c863..4feb0ea0 100644 --- a/bigchaindb/backend/query.py +++ b/bigchaindb/backend/query.py @@ -14,7 +14,7 @@ PRE_COMMIT_ID = 'a_unique_id_string' @singledispatch def store_transaction(connection, signed_transaction): - """Write a transaction to the backlog table. + """Write a signed transaction to the 'transactions' table. Args: signed_transaction (dict): a signed transaction. diff --git a/bigchaindb/backend/schema.py b/bigchaindb/backend/schema.py index cf777a0c..04c1bdd0 100644 --- a/bigchaindb/backend/schema.py +++ b/bigchaindb/backend/schema.py @@ -2,16 +2,7 @@ # SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0) # Code is Apache-2.0 and docs are CC-BY-4.0 -"""Database creation and schema-providing interfaces for backends. - -Attributes: - TABLES (tuple): The three standard tables BigchainDB relies on: - - * ``backlog`` for incoming transactions awaiting to be put into - a block. - * ``bigchain`` for blocks. - -""" +"""Database creation and schema-providing interfaces for backends.""" from functools import singledispatch import logging @@ -23,7 +14,10 @@ from bigchaindb.common.utils import validate_all_values_for_key logger = logging.getLogger(__name__) -TABLES = ('bigchain', 'backlog', 'assets', 'metadata') +# Tables/collections that every backend database must create +TABLES = ('transactions', 'blocks', 'assets', 'metadata', + 'validators', 'pre_commit', 'utxos') + VALID_LANGUAGES = ('danish', 'dutch', 'english', 'finnish', 'french', 'german', 'hungarian', 'italian', 'norwegian', 'portuguese', 'romanian', 'russian', 'spanish', 'swedish', 'turkish', 'none',