Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for Item (0.15 sec)

  1. 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)
  2. 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)
  3. tests/query_test.go

    		Item1: &QueryResetItem{
    			ID:   "u_1_1",
    			Name: "item_1_1",
    		},
    		Item2: &QueryResetItem{
    			ID:   "u_1_2",
    			Name: "item_1_2",
    		},
    	}
    
    	q2 := QueryResetNullValue{
    		Item1: &QueryResetItem{
    			ID:   "u_2_1",
    			Name: "item_2_1",
    		},
    		Item2: &QueryResetItem{
    			ID:   "u_2_2",
    			Name: "item_2_2",
    		},
    	}
    
    	var err error
    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)
Back to top