Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 4 of 4 for mouton (0.19 sec)

  1. tests/associations_test.go

    	}
    
    	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 {
    		t.Errorf("failed to create orders, got %v", err)
    	}
    
    	coupon2 := Coupon{
    Go
    - Registered: Sun Apr 21 09:35:09 GMT 2024
    - Last Modified: Wed Feb 08 08:29:09 GMT 2023
    - 10.9K bytes
    - Viewed (0)
  2. tests/tests_test.go

    		db.Logger = db.Logger.LogMode(logger.Silent)
    	}
    
    	return
    }
    
    func RunMigrations() {
    	var err error
    	allModels := []interface{}{&User{}, &Account{}, &Pet{}, &Company{}, &Toy{}, &Language{}, &Coupon{}, &CouponProduct{}, &Order{}, &Parent{}, &Child{}, &Tools{}}
    	rand.Seed(time.Now().UnixNano())
    	rand.Shuffle(len(allModels), func(i, j int) { allModels[i], allModels[j] = allModels[j], allModels[i] })
    
    Go
    - Registered: Sun Apr 21 09:35:09 GMT 2024
    - Last Modified: Fri Dec 15 08:36:08 GMT 2023
    - 3.3K bytes
    - Viewed (1)
  3. utils/tests/models.go

    }
    
    type CouponProduct struct {
    	CouponId  int    `gorm:"primarykey;size:255"`
    	ProductId string `gorm:"primarykey;size:255"`
    	Desc      string
    }
    
    type Order struct {
    	gorm.Model
    	Num      string
    	Coupon   *Coupon
    	CouponID string
    }
    
    type Parent struct {
    	gorm.Model
    	FavChildID uint
    	FavChild   *Child
    	Children   []*Child
    }
    
    type Child struct {
    	gorm.Model
    	Name     string
    	ParentID *uint
    Go
    - Registered: Sun Apr 21 09:35:09 GMT 2024
    - Last Modified: Fri Dec 15 08:36:08 GMT 2023
    - 2.1K bytes
    - Viewed (0)
  4. tests/migrate_test.go

    func TestMigrateWithSpecialName(t *testing.T) {
    	var err error
    	err = DB.AutoMigrate(&Coupon{})
    	if err != nil {
    		t.Fatalf("AutoMigrate err:%v", err)
    	}
    	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)
    	}
    
    Go
    - Registered: Sun Apr 21 09:35:09 GMT 2024
    - Last Modified: Mon Mar 18 11:24:16 GMT 2024
    - 56.2K bytes
    - Viewed (0)
Back to top