- Sort Score
- Result 10 results
- Languages All
Results 1 - 3 of 3 for Item (0.2 sec)
-
tests/associations_has_many_test.go
LanguageCode string `gorm:"not null;type:varchar(2)"` } type Item struct { gorm.Model Logo string `gorm:"not null;type:varchar(50)"` Contents []ItemContent `gorm:"foreignKey:ItemID"` } tx := DB.Session(&gorm.Session{}) tx.Migrator().DropTable(&ItemContent{}, &Item{}) tx.AutoMigrate(&ItemContent{}, &Item{}) item := Item{ Logo: "logo", Contents: []ItemContent{
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Fri Dec 15 08:36:08 GMT 2023 - 15.6K bytes - Viewed (0) -
tests/associations_belongs_to_test.go
tx.AutoMigrate(&ItemParent{}, &ItemChild{}) item := ItemChild{ Name: "name", ItemParent: ItemParent{ Logo: "logo", }, } if err := tx.Create(&item).Error; err != nil { t.Fatalf("failed to create items, got error: %v", err) } // test replace if err := tx.Model(&item).Association("ItemParent").Unscoped().Replace(&ItemParent{ Logo: "updated logo",
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Mon Oct 30 09:15:49 GMT 2023 - 9.3K bytes - Viewed (0) -
tests/query_test.go
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)