Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 1 - 1 of 1 for TestCreateWithAutoIncrementCompositeKey (0.17 seconds)

  1. tests/create_test.go

    	res = DB.FirstOrCreate(&user, "name = ?", user.Name)
    	if res.Error != nil || res.RowsAffected != 0 {
    		t.Fatalf("first or create rows affect err:%v rows:%d", res.Error, res.RowsAffected)
    	}
    }
    
    func TestCreateWithAutoIncrementCompositeKey(t *testing.T) {
    	type CompositeKeyProduct struct {
    		ProductID    int `gorm:"primaryKey;autoIncrement:true;"` // primary key
    		LanguageCode int `gorm:"primaryKey;"`                    // primary key
    Created: Sun Dec 28 09:35:17 GMT 2025
    - Last Modified: Mon Jul 21 09:55:20 GMT 2025
    - 26.8K bytes
    - Click Count (0)
Back to Top