Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for post_categories (0.2 sec)

  1. tests/postgres_test.go

    	Title      string
    	Categories []*Category `gorm:"Many2Many:post_categories"`
    }
    
    type Category struct {
    	ID    uuid.UUID `gorm:"primary_key;type:uuid;default:uuid_generate_v4();"`
    	Title string
    	Posts []*Post `gorm:"Many2Many:post_categories"`
    }
    
    func TestMany2ManyWithDefaultValueUUID(t *testing.T) {
    	if DB.Dialector.Name() != "postgres" {
    		t.Skip()
    	}
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Sat Oct 08 09:16:32 GMT 2022
    - 6.4K bytes
    - Viewed (3)
Back to top