- Sort Score
- Result 10 results
- Languages All
Results 1 - 3 of 3 for Child1 (0.18 sec)
-
tests/associations_test.go
parent := Parent{} DB.Create(&parent) child := Child{ParentID: &parent.ID, Parent: &parent, Name: "HasManyCircularReference"} child1 := Child{ParentID: &parent.ID, Parent: &parent, Name: "HasManyCircularReference1"} parent.Children = []*Child{&child, &child1} DB.Save(&parent) var children []*Child DB.Where("parent_id = ?", parent.ID).Find(&children)
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) -
utils/tests/models.go
} 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 Parent *Parent
Go - Registered: Sun Apr 28 09:35:09 GMT 2024 - Last Modified: Fri Dec 15 08:36:08 GMT 2023 - 2.1K bytes - Viewed (0) -
tests/tests_test.go
} 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] }) DB.Migrator().DropTable("user_friends", "user_speaks")
Go - Registered: Sun Apr 28 09:35:09 GMT 2024 - Last Modified: Fri Dec 15 08:36:08 GMT 2023 - 3.3K bytes - Viewed (1)