Search Options

Results per page
Sort
Preferred Languages
Advance

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

  1. tests/migrate_test.go

    		}
    		_ = 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 {
    			t.Fatalf("%v: %q column %q unique should be %v but got %v", utils.FileWithLineNum(), stmt.Schema.Table, fieldName, unique, field.Unique)
    		}
    		if field.UniqueIndex != uniqueIndex {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Mar 18 11:24:16 GMT 2024
    - 56.2K bytes
    - Viewed (0)
  2. tests/query_test.go

    	}
    
    	stmt := dryDB.Clauses(clause.OrderBy{
    		Expression: clause.Expr{SQL: "FIELD(id,?)", Vars: []interface{}{[]int{1, 2, 3}}, WithoutParentheses: true},
    	}).Find(&User{}).Statement
    
    	explainedSQL := dryDB.Dialector.Explain(stmt.SQL.String(), stmt.Vars...)
    	if !regexp.MustCompile("SELECT \\* FROM .*users.* ORDER BY FIELD\\(id,1,2,3\\)").MatchString(explainedSQL) {
    		t.Fatalf("Build Order condition, but got %v", explainedSQL)
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Apr 25 12:22:53 GMT 2024
    - 49.8K bytes
    - Viewed (0)
Back to top