Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for ParseIndexes (0.18 sec)

  1. 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 {
    Registered: Sun Sep 07 09:35:13 UTC 2025
    - Last Modified: Wed May 21 02:35:56 UTC 2025
    - 3.8K bytes
    - Viewed (0)
  2. 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"`       // unique
    
    Registered: Sun Sep 07 09:35:13 UTC 2025
    - Last Modified: Fri Dec 06 02:27:44 UTC 2024
    - 7.9K bytes
    - Viewed (0)
Back to top