- Sort Score
- Num 10 results
- Language All
Results 1 - 3 of 3 for ParseIndexes (0.07 seconds)
The search processing time has exceeded the limit. The displayed results may be partial.
-
schema/index.go
} type IndexOption struct { *Field Expression string Sort string // DESC, ASC Collate string Length int Priority int } // ParseIndexes parse schema indexes func (schema *Schema) ParseIndexes() []*Index { indexesByName := map[string]*Index{} indexes := []*Index{} for _, field := range schema.Fields {Created: Sun Apr 05 09:35:12 GMT 2026 - Last Modified: Wed May 21 02:35:56 GMT 2025 - 3.8K bytes - Click Count (0) -
schema/index_test.go
Field: &schema.Field{Name: "Data2C"}, }, { Field: &schema.Field{Name: "Data2A"}, }, { Field: &schema.Field{Name: "Data2B"}, }}, }, } CheckIndices(t, results, user.ParseIndexes()) } func TestParseIndexWithUniqueIndexAndUnique(t *testing.T) { type IndexTest struct { FieldA string `gorm:"unique;index"` // unique and index FieldB string `gorm:"unique"` // uniqueCreated: Sun Apr 05 09:35:12 GMT 2026 - Last Modified: Fri Dec 06 02:27:44 GMT 2024 - 7.9K bytes - Click Count (0) -
tests/migrate_test.go
stmt := &gorm.Statement{DB: DB} err := stmt.Parse(model) if err != nil { t.Fatalf("%v: failed to parse schema, got error: %v", utils.FileWithLineNum(), err) } _ = stmt.Schema.ParseIndexes() field := stmt.Schema.LookUpField(fieldName) if field == nil { t.Fatalf("%v: failed to find column %q", utils.FileWithLineNum(), fieldName) } if field.Unique != unique {Created: Sun Apr 05 09:35:12 GMT 2026 - Last Modified: Sat Mar 21 11:49:01 GMT 2026 - 66.3K bytes - Click Count (0)