Skip to content
This repository has been archived by the owner on Jan 8, 2025. It is now read-only.

dev: add migration procedure for the MongoDB [2] #1293

Open
@greged93

Description

Describe the enhancement request

Indexes have been added to the Mongo but we should have some migration procedure from Karnot in case we ever want to update these or change the Mongo models. This needs to be discussed with Karnot.

Tasks

Preview Give feedback
db.headers.getIndexes()
[
  { v: 2, key: { _id: 1 }, name: '_id_' },
  { v: 2, key: { 'header.hash': 1 }, name: 'header.hash_1' },
  { v: 2, key: { 'header.number': 1 }, name: 'header.number_1' },
  { v: 2, key: { '_cursor.from': 1 }, name: '_cursor.from_1' },
  { v: 2, key: { '_cursor.to': 1 }, name: '_cursor.to_1' }
]

db.receipts.getIndexes()
[
  { v: 2, key: { _id: 1 }, name: '_id_' },
  {
    v: 2,
    key: { 'receipt.blockHash': 1 },
    name: 'receipt.blockHash_1'
  },
  {
    v: 2,
    key: { 'receipt.blockNumber': 1 },
    name: 'receipt.blockNumber_1'
  },
  {
    v: 2,
    key: { 'receipt.transactionHash': 1 },
    name: 'receipt.transactionHash_1'
  },
  { v: 2, key: { '_cursor.from': 1 }, name: '_cursor.from_1' },
  { v: 2, key: { '_cursor.to': 1 }, name: '_cursor.to_1' }
]

db.transactions.getIndexes()

[
  { v: 2, key: { _id: 1 }, name: '_id_' },
  { v: 2, key: { 'tx.blockHash': 1 }, name: 'tx.blockHash_1' },
  { v: 2, key: { 'tx.blockNumber': 1 }, name: 'tx.blockNumber_1' },
  { v: 2, key: { '_cursor.from': 1 }, name: '_cursor.from_1' },
  { v: 2, key: { 'tx.hash': 1 }, name: 'tx.hash_1' },
  { v: 2, key: { '_cursor.to': 1 }, name: '_cursor.to_1' }
]

db.logs.getIndexes()
[
  { v: 2, key: { _id: 1 }, name: '_id_' },
  { v: 2, key: { '_cursor.from': 1 }, name: '_cursor.from_1' },
  { v: 2, key: { '_cursor.to': 1 }, name: '_cursor.to_1' }
]

Metadata

Assignees

No one assigned

    Labels

    enhancementEnhancement of the code, not introducing new features.

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions