Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for or (0.5 sec)

  1. tests/migrate_test.go

    	}
    
    	type ColumnStruct2 struct {
    		gorm.Model
    		Name         string
    		StringBool   bool // change existing boolean column from string to boolean
    		SmallintBool bool // change existing boolean column from smallint or other to boolean
    	}
    
    	DB.Migrator().DropTable(&ColumnStruct{})
    
    	if err := DB.AutoMigrate(&ColumnStruct{}); err != nil {
    		t.Errorf("Failed to migrate, got %v", err)
    	}
    
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Mon Mar 18 11:24:16 GMT 2024
    - 56.2K bytes
    - Viewed (0)
  2. tests/query_test.go

    		t.Fatalf("Build OR condition, but got %v", result.Statement.SQL.String())
    	}
    
    	result = dryDB.Where("role = ?", "admin").Where(DB.Or("role = ?", "super_admin").Or("role = ?", "admin")).Find(&User{})
    	if !regexp.MustCompile("SELECT \\* FROM .*users.* WHERE .*role.* = .+ AND (.*role.* = .+ OR .*role.* = .+)").MatchString(result.Statement.SQL.String()) {
    		t.Fatalf("Build OR condition, but got %v", result.Statement.SQL.String())
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Thu Apr 25 12:22:53 GMT 2024
    - 49.8K bytes
    - Viewed (0)
Back to top