Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for LookIndex (0.08 sec)

  1. schema/index.go

    			}
    		}
    	}
    	for _, index := range indexes {
    		if index.Class == "UNIQUE" && len(index.Fields) == 1 {
    			index.Fields[0].Field.UniqueIndex = index.Name
    		}
    	}
    	return indexes
    }
    
    func (schema *Schema) LookIndex(name string) *Index {
    	if schema != nil {
    		indexes := schema.ParseIndexes()
    		for _, index := range indexes {
    			if index.Name == name {
    				return &index
    			}
    
    			for _, field := range index.Fields {
    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. migrator/migrator.go

    	return m.RunWithValue(value, func(stmt *gorm.Statement) error {
    		if stmt.Schema == nil {
    			return errors.New("failed to get schema")
    		}
    		if idx := stmt.Schema.LookIndex(name); idx != nil {
    			opts := m.DB.Migrator().(BuildIndexOptionsInterface).BuildIndexOptions(idx.Fields, stmt)
    			values := []interface{}{clause.Column{Name: idx.Name}, m.CurrentTable(stmt), opts}
    
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Fri Apr 26 07:15:49 UTC 2024
    - 29K bytes
    - Viewed (0)
Back to top