-
Notifications
You must be signed in to change notification settings - Fork 35
/
prefix_schema.go
25 lines (20 loc) · 1.05 KB
/
prefix_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
package bsdb
import (
"github.com/forbole/juno/v4/common"
)
// SlashPrefixTreeNode A tree structure based on prefixes
type SlashPrefixTreeNode struct {
ID uint64 `gorm:"column:id;primaryKey"`
PathName string `gorm:"column:path_name;type:varchar(1024);index:idx_bucket_path,priority:2,length:512"`
FullName string `gorm:"column:full_name;type:varchar(1024);index:idx_bucket_full_object,priority:2,length:512"`
Name string `gorm:"column:name;type:varchar(1024)"`
IsObject bool `gorm:"column:is_object;default:false;index:idx_bucket_full_object,priority:3"`
IsFolder bool `gorm:"column:is_folder;default:false"`
BucketName string `gorm:"column:bucket_name;type:varchar(64);index:idx_bucket_full_object,priority:1;index:idx_bucket_path,priority:1"`
ObjectID common.Hash `gorm:"column:object_id;type:BINARY(32);index:idx_object_id"`
ObjectName string `gorm:"column:object_name;type:varchar(1024)"`
}
// TableName is used to set SlashPrefixTreeNode table name in database
func (*SlashPrefixTreeNode) TableName() string {
return PrefixTreeTableName
}