Skip to content

Commit

Permalink
Add index on operations
Browse files Browse the repository at this point in the history
  • Loading branch information
aopoltorzhicky committed Oct 14, 2021
1 parent 89d866f commit e10113d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions internal/models/operation/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ import (
type Operation struct {
ID int64 `json:"-"`

ContentIndex int64 `json:"content_index,omitempty" gorm:",default:0"`
ContentIndex int64 `json:"content_index,omitempty" gorm:"index:new_opg_idx,default:0"`
Level int64 `json:"level" gorm:"index:idx_operations_level_network"`
Counter int64 `json:"counter,omitempty" gorm:"index:opg_idx"`
Counter int64 `json:"counter,omitempty" gorm:"index:new_opg_idx"`
Fee int64 `json:"fee,omitempty"`
GasLimit int64 `json:"gas_limit,omitempty"`
StorageLimit int64 `json:"storage_limit,omitempty"`
Expand All @@ -34,10 +34,10 @@ type Operation struct {
Burned int64 `json:"burned,omitempty"`
AllocatedDestinationContractBurned int64 `json:"allocated_destination_contract_burned,omitempty"`

Nonce *int64 `json:"nonce,omitempty" gorm:"index:opg_idx"`
Nonce *int64 `json:"nonce,omitempty"`
Network types.Network `json:"network" gorm:"type:SMALLINT;index:idx_operations_level_network"`
ProtocolID int64 `json:"protocol" gorm:"type:SMALLINT"`
Hash string `json:"hash" gorm:"index:opg_idx;index:operations_hash_idx"`
Hash string `json:"hash" gorm:"index:new_opg_idx;index:operations_hash_idx"`

Timestamp time.Time `json:"timestamp"`
Status types.OperationStatus `json:"status" gorm:"type:SMALLINT"`
Expand Down

0 comments on commit e10113d

Please sign in to comment.