Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 7 of 7 for Migrator (0.14 sec)

  1. tests/hooks_test.go

    }
    
    func TestRunCallbacks(t *testing.T) {
    	DB.Migrator().DropTable(&Product{})
    	DB.AutoMigrate(&Product{})
    
    	p := Product{Code: "unique_code", Price: 100}
    	DB.Save(&p)
    
    	if !reflect.DeepEqual(p.GetCallTimes(), []int64{1, 1, 0, 1, 1, 0, 0, 0, 0}) {
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Mon Jun 17 03:59:06 UTC 2024
    - 16.7K bytes
    - Viewed (0)
  2. tests/tests_test.go

    	rand.Seed(time.Now().UnixNano())
    	rand.Shuffle(len(allModels), func(i, j int) { allModels[i], allModels[j] = allModels[j], allModels[i] })
    
    	DB.Migrator().DropTable("user_friends", "user_speaks")
    
    	if err = DB.Migrator().DropTable(allModels...); err != nil {
    		log.Printf("Failed to drop table, got error %v\n", err)
    		os.Exit(1)
    	}
    
    	if err = DB.AutoMigrate(allModels...); err != nil {
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Mon Sep 30 03:21:19 UTC 2024
    - 3.3K bytes
    - Viewed (0)
  3. tests/preload_test.go

    			Preloads []*Preload
    			Join     Join
    			ValueID  uint
    		}
    		Value struct {
    			ID     uint
    			Name   string
    			Nested Nested
    		}
    	)
    
    	DB.Migrator().DropTable(&Preload{}, &Join{}, &Nested{}, &Value{})
    	DB.Migrator().AutoMigrate(&Preload{}, &Join{}, &Nested{}, &Value{})
    
    	value1 := Value{
    		Name: "value",
    		Nested: Nested{
    			Preloads: []*Preload{
    				{Value: "p1"}, {Value: "p2"},
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Wed Jun 12 10:00:47 UTC 2024
    - 15.9K bytes
    - Viewed (0)
  4. tests/joins_test.go

    			CompanyID  *uint
    			Company    Company
    		}
    
    		Building struct {
    			gorm.Model
    			Name    string
    			OwnerID *uint
    			Owner   Owner
    		}
    	)
    
    	DB.Migrator().DropTable(&Building{}, &Owner{}, &Furniture{})
    	DB.Migrator().AutoMigrate(&Building{}, &Owner{}, &Furniture{})
    
    	home := &Building{Name: "relation_empty"}
    	DB.Create(home)
    
    	var entries []Building
    	assert.NotPanics(t, func() {
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Mon Jun 17 03:58:13 UTC 2024
    - 15K bytes
    - Viewed (0)
  5. tests/associations_has_many_test.go

    	}
    	type Item struct {
    		gorm.Model
    		Logo     string        `gorm:"not null;type:varchar(50)"`
    		Contents []ItemContent `gorm:"foreignKey:ItemID"`
    	}
    
    	tx := DB.Session(&gorm.Session{})
    	tx.Migrator().DropTable(&ItemContent{}, &Item{})
    	tx.AutoMigrate(&ItemContent{}, &Item{})
    
    	item := Item{
    		Logo: "logo",
    		Contents: []ItemContent{
    			{Name: "name", LanguageCode: "en"},
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Wed Jun 12 10:49:45 UTC 2024
    - 16K bytes
    - Viewed (0)
  6. tests/query_test.go

    	}
    }
    
    func TestCustomizedTypePrimaryKey(t *testing.T) {
    	type ID uint
    	type CustomizedTypePrimaryKey struct {
    		ID   ID
    		Name string
    	}
    
    	DB.Migrator().DropTable(&CustomizedTypePrimaryKey{})
    	if err := DB.AutoMigrate(&CustomizedTypePrimaryKey{}); err != nil {
    		t.Fatalf("failed to migrate, got error %v", err)
    	}
    
    	p1 := CustomizedTypePrimaryKey{Name: "p1"}
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Mon Jun 24 09:42:59 UTC 2024
    - 50.4K bytes
    - Viewed (0)
  7. CHANGELOG/CHANGELOG-1.31.md

    - Fixed a bug in storage-version-migrator-controller that would cause migration attempts to fail if resources were deleted when the migration was in progress. ([#126107](https://github.com/kubernetes/kubernetes/pull/126107), [@enj](https://github.com/enj)) [SIG API Machinery, Apps, Auth...
    Registered: Fri Nov 01 09:05:11 UTC 2024
    - Last Modified: Wed Oct 23 12:18:32 UTC 2024
    - 315.4K bytes
    - Viewed (0)
Back to top