Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for ParseIndexes (0.15 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() map[string]Index {
    	indexes := map[string]Index{}
    
    	for _, field := range schema.Fields {
    		if field.TagSettings["INDEX"] != "" || field.TagSettings["UNIQUEINDEX"] != "" {
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Sun Feb 04 07:49:19 UTC 2024
    - 3.7K 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 Nov 03 09:35:10 UTC 2024
    - Last Modified: Sun Feb 04 07:49:19 UTC 2024
    - 8K bytes
    - Viewed (0)
Back to top