mirror of
https://github.com/bigchaindb/bigchaindb.git
synced 2024-10-13 13:34:05 +00:00
Added secondary index for "id" in bigchain collection.
This commit is contained in:
parent
ad6dd9a5af
commit
ddfce61b79
@ -50,6 +50,11 @@ def drop_database(conn, dbname):
|
|||||||
def create_bigchain_secondary_index(conn, dbname):
|
def create_bigchain_secondary_index(conn, dbname):
|
||||||
logger.info('Create `bigchain` secondary index.')
|
logger.info('Create `bigchain` secondary index.')
|
||||||
|
|
||||||
|
# secondary index on block id which is should be unique
|
||||||
|
conn.conn[dbname]['bigchain'].create_index('id',
|
||||||
|
name='block_id',
|
||||||
|
unique=True)
|
||||||
|
|
||||||
# to order blocks by timestamp
|
# to order blocks by timestamp
|
||||||
conn.conn[dbname]['bigchain'].create_index([('block.timestamp',
|
conn.conn[dbname]['bigchain'].create_index([('block.timestamp',
|
||||||
ASCENDING)],
|
ASCENDING)],
|
||||||
|
Loading…
x
Reference in New Issue
Block a user