Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for period (0.2 sec)

  1. schema/relationship_test.go

    func TestMultipleMany2Many(t *testing.T) {
    	type Thing struct {
    		ID int
    	}
    
    	type Person struct {
    		ID       int
    		Likes    []Thing `gorm:"many2many:likes"`
    		Dislikes []Thing `gorm:"many2many:dislikes"`
    	}
    
    	checkStructRelation(t, &Person{},
    		Relation{
    			Name: "Likes", Type: schema.Many2Many, Schema: "Person", FieldSchema: "Thing",
    			JoinTable: JoinTable{Name: "likes", Table: "likes"},
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Apr 15 03:20:20 GMT 2024
    - 25.5K bytes
    - Viewed (0)
  2. tests/create_test.go

    	}
    	if err := DB.AutoMigrate(&CompositeKeyProduct{}); err != nil {
    		t.Fatalf("failed to migrate, got error %v", err)
    	}
    
    	prod := &CompositeKeyProduct{
    		LanguageCode: 56,
    		Code:         "Code56",
    		Name:         "ProductName56",
    	}
    	if err := DB.Create(&prod).Error; err != nil {
    		t.Fatalf("failed to create, got error %v", err)
    	}
    
    	newProd := &CompositeKeyProduct{}
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Tue Mar 19 03:50:28 GMT 2024
    - 26.4K bytes
    - Viewed (0)
Back to top