Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 6 of 6 for Products (0.18 sec)

  1. tests/hooks_test.go

    	DB.Model(&product).Updates(Product3{Code: "L1214"})
    	if product.Price != 270 || product.Code != "L1214" {
    		t.Errorf("invalid data after update, got %+v", product)
    	}
    
    	// Code changed, price should changed
    	DB.Model(&product).Select("Name", "Code", "Price").Updates(Product3{Name: "Product New4", Code: ""})
    	if product.Name != "Product New4" || product.Price != 320 || product.Code != "" {
    		t.Errorf("invalid data after update, got %+v", product)
    	}
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Sat Feb 18 01:20:29 GMT 2023
    - 15.9K bytes
    - Viewed (0)
  2. clause/insert_test.go

    		{
    			[]clause.Interface{clause.Insert{Modifier: "LOW_PRIORITY"}},
    			"INSERT LOW_PRIORITY INTO `users`", nil,
    		},
    		{
    			[]clause.Interface{clause.Insert{Table: clause.Table{Name: "products"}, Modifier: "LOW_PRIORITY"}},
    			"INSERT LOW_PRIORITY INTO `products`", nil,
    		},
    	}
    
    	for idx, result := range results {
    		t.Run(fmt.Sprintf("case #%v", idx), func(t *testing.T) {
    			checkBuildClauses(t, result.Clauses, result.Result, result.Vars)
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Tue Jun 02 01:18:01 GMT 2020
    - 737 bytes
    - Viewed (0)
  3. clause/update_test.go

    		},
    		{
    			[]clause.Interface{clause.Update{Modifier: "LOW_PRIORITY"}},
    			"UPDATE LOW_PRIORITY `users`", nil,
    		},
    		{
    			[]clause.Interface{clause.Update{Table: clause.Table{Name: "products"}, Modifier: "LOW_PRIORITY"}},
    			"UPDATE LOW_PRIORITY `products`", nil,
    		},
    	}
    
    	for idx, result := range results {
    		t.Run(fmt.Sprintf("case #%v", idx), func(t *testing.T) {
    			checkBuildClauses(t, result.Clauses, result.Result, result.Vars)
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Tue Jun 02 01:18:01 GMT 2020
    - 722 bytes
    - Viewed (0)
  4. schema/schema_test.go

    		Code         string
    		Name         string
    	}
    
    	product, err := schema.Parse(&Product{}, &sync.Map{}, schema.NamingStrategy{})
    	if err != nil {
    		t.Fatalf("failed to parse product struct with composite primary key, got error %v", err)
    	}
    
    	prioritizedPrimaryField := schema.Field{
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Fri Dec 15 08:31:23 GMT 2023
    - 12.9K bytes
    - Viewed (0)
  5. tests/migrate_test.go

    	}
    	err = DB.Table("coupon_product_1").AutoMigrate(&CouponProduct{})
    	if err != nil {
    		t.Fatalf("AutoMigrate err:%v", err)
    	}
    	err = DB.Table("coupon_product_2").AutoMigrate(&CouponProduct{})
    	if err != nil {
    		t.Fatalf("AutoMigrate err:%v", err)
    	}
    
    	AssertEqual(t, true, DB.Migrator().HasTable("coupons"))
    	AssertEqual(t, true, DB.Migrator().HasTable("coupon_product_1"))
    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)
  6. tests/associations_test.go

    	}
    
    	if DB.First(&Coupon{}, "id = ?", coupon.ID).Error != nil {
    		t.Errorf("Failed to query saved coupon")
    	}
    
    	if DB.First(&CouponProduct{}, "coupon_id = ? AND product_id = ?", coupon.ID, "full-save-association-product1").Error != nil {
    		t.Errorf("Failed to query saved association")
    	}
    
    	orders := []Order{{Num: "order1", Coupon: coupon}, {Num: "order2", Coupon: coupon}}
    	if err := DB.Create(&orders).Error; err != nil {
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Wed Feb 08 08:29:09 GMT 2023
    - 10.9K bytes
    - Viewed (0)
Back to top