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):
|
||||
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
|
||||
conn.conn[dbname]['bigchain'].create_index([('block.timestamp',
|
||||
ASCENDING)],
|
||||
|
|
Loading…
Reference in New Issue