Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for ItemParent (0.19 sec)

  1. tests/associations_belongs_to_test.go

    func TestBelongsToAssociationUnscoped(t *testing.T) {
    	type ItemParent struct {
    		gorm.Model
    		Logo string `gorm:"not null;type:varchar(50)"`
    	}
    	type ItemChild struct {
    		gorm.Model
    		Name         string `gorm:"type:varchar(50)"`
    		ItemParentID uint
    		ItemParent   ItemParent
    	}
    
    	tx := DB.Session(&gorm.Session{})
    	tx.Migrator().DropTable(&ItemParent{}, &ItemChild{})
    	tx.AutoMigrate(&ItemParent{}, &ItemChild{})
    
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Mon Oct 30 09:15:49 GMT 2023
    - 9.3K bytes
    - Viewed (0)
Back to top