Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for uniqueConstraints (0.2 sec)

  1. migrator/migrator.go

    		for k := range checkConstraints {
    			if checkConstraints[k].Field == field {
    				v := checkConstraints[k]
    				return &v, stmt.Table
    			}
    		}
    
    		for k := range uniqueConstraints {
    			if uniqueConstraints[k].Field == field {
    				v := uniqueConstraints[k]
    				return &v, stmt.Table
    			}
    		}
    
    		for _, rel := range stmt.Schema.Relationships.Relations {
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Fri Apr 26 07:15:49 UTC 2024
    - 29K bytes
    - Viewed (0)
  2. schema/constraint.go

    				checks[name] = CheckConstraint{Name: name, Constraint: chk, Field: field}
    			}
    		}
    	}
    	return checks
    }
    
    type UniqueConstraint struct {
    	Name  string
    	Field *Field
    }
    
    func (uni *UniqueConstraint) GetName() string { return uni.Name }
    
    func (uni *UniqueConstraint) Build() (sql string, vars []interface{}) {
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Mon Mar 18 07:33:54 UTC 2024
    - 1.9K bytes
    - Viewed (0)
  3. schema/constraint_test.go

    	if err != nil {
    		t.Fatalf("failed to parse user unique, got error %v", err)
    	}
    	constraints := user.ParseUniqueConstraints()
    
    	results := map[string]schema.UniqueConstraint{
    		"uni_user_uniques_name1": {
    			Name:  "uni_user_uniques_name1",
    			Field: &schema.Field{Name: "Name1", Unique: true},
    		},
    	}
    	for k, result := range results {
    		v, ok := constraints[k]
    		if !ok {
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Sun Feb 04 07:49:19 UTC 2024
    - 2.2K bytes
    - Viewed (0)
Back to top