Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for label (0.14 sec)

  1. tests/multi_primary_keys_test.go

    	}
    }
    
    func TestCompositePrimaryKeysAssociations(t *testing.T) {
    	type Label struct {
    		BookID *uint  `gorm:"primarykey"`
    		Name   string `gorm:"primarykey"`
    		Value  string
    	}
    
    	type Book struct {
    		ID     int
    		Name   string
    		Labels []Label
    	}
    
    	DB.Migrator().DropTable(&Label{}, &Book{})
    	if err := DB.AutoMigrate(&Label{}, &Book{}); err != nil {
    		t.Fatalf("failed to migrate, got %v", err)
    	}
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Jan 06 07:02:53 GMT 2022
    - 12.8K bytes
    - Viewed (0)
Back to top