From 4ef3af10ed7478255f7fade8c27ccf7af149439d Mon Sep 17 00:00:00 2001 From: nowindexman <240440387@qq.com> Date: Sun, 12 Jan 2025 18:16:48 +0800 Subject: [PATCH] feat:Capitalize the priority field of IndexOption so that other systems can access this field from outside the package. (#7342) --- schema/index.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/schema/index.go b/schema/index.go index 786e21046..72fc6ca8e 100644 --- a/schema/index.go +++ b/schema/index.go @@ -23,7 +23,7 @@ type IndexOption struct { Sort string // DESC, ASC Collate string Length int - priority int + Priority int } // ParseIndexes parse schema indexes @@ -64,7 +64,7 @@ func (schema *Schema) ParseIndexes() []*Index { idx.Fields = append(idx.Fields, index.Fields...) sort.Slice(idx.Fields, func(i, j int) bool { - return idx.Fields[i].priority < idx.Fields[j].priority + return idx.Fields[i].Priority < idx.Fields[j].Priority }) } } @@ -155,7 +155,7 @@ func parseFieldIndexes(field *Field) (indexes []Index, err error) { Sort: settings["SORT"], Collate: settings["COLLATE"], Length: length, - priority: priority, + Priority: priority, }}, }) }