-
Notifications
You must be signed in to change notification settings - Fork 39
/
global_virtual_group_schema.go
30 lines (26 loc) · 1.42 KB
/
global_virtual_group_schema.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package bsdb
import (
"github.com/forbole/juno/v4/common"
)
// GlobalVirtualGroup is a global virtual group consists of one primary SP (SP) and multiple secondary SP.
type GlobalVirtualGroup struct {
ID uint64 `gorm:"column:id;primaryKey"`
GlobalVirtualGroupId uint32 `gorm:"column:global_virtual_group_id;index:idx_gvg_id"`
FamilyId uint32 `gorm:"column:family_id"`
PrimarySpId uint32 `gorm:"column:primary_sp_id;index:idx_primary_sp_id"`
SecondarySpIds Uint32Array `gorm:"column:secondary_sp_ids;type:TEXT"`
StoredSize uint64 `gorm:"column:stored_size"`
VirtualPaymentAddress common.Address `gorm:"column:virtual_payment_address;type:BINARY(20)"`
TotalDeposit *common.Big `gorm:"column:total_deposit"`
CreateAt int64 `gorm:"column:create_at"`
CreateTxHash common.Hash `gorm:"column:create_tx_hash;type:BINARY(32);not null"`
CreateTime int64 `gorm:"column:create_time"` // seconds
UpdateAt int64 `gorm:"column:update_at"`
UpdateTxHash common.Hash `gorm:"column:update_tx_hash;type:BINARY(32);not null"`
UpdateTime int64 `gorm:"column:update_time"` // seconds
Removed bool `gorm:"column:removed;default:false"`
}
// TableName is used to set GlobalVirtualGroup table name in database
func (g *GlobalVirtualGroup) TableName() string {
return GlobalVirtualGroupTableName
}