Skip to content

Commit

Permalink
feat: setup db index for delegation and timelock collection (#105)
Browse files Browse the repository at this point in the history
  • Loading branch information
jrwbabylonlab authored Jan 3, 2025
1 parent 4b3aae4 commit d14c8a4
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions internal/db/model/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,14 @@ type index struct {

var collections = map[string][]index{
FinalityProviderDetailsCollection: {{Indexes: map[string]int{}}},
BTCDelegationDetailsCollection: {{Indexes: map[string]int{}}},
TimeLockCollection: {{Indexes: map[string]int{}}},
GlobalParamsCollection: {{Indexes: map[string]int{}}},
LastProcessedHeightCollection: {{Indexes: map[string]int{}}},
BTCDelegationDetailsCollection: {
{Indexes: map[string]int{"staker_btc_pk_hex": 1, "start_height": -1, "_id": 1}, Unique: false},
},
TimeLockCollection: {
{Indexes: map[string]int{"expire_height": 1}, Unique: false},
},
GlobalParamsCollection: {{Indexes: map[string]int{}}},
LastProcessedHeightCollection: {{Indexes: map[string]int{}}},
}

func Setup(ctx context.Context, cfg *config.Config) error {
Expand Down

0 comments on commit d14c8a4

Please sign in to comment.