Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for AutoMigrate (0.04 sec)

  1. tests/migrate_test.go

    	// create sequence
    	err = DB.Table("events").AutoMigrate(&Event1{})
    	if err != nil {
    		t.Errorf("AutoMigrate err:%v", err)
    	}
    
    	// delete sequence
    	err = DB.Table("events").AutoMigrate(&Event{})
    	if err != nil {
    		t.Errorf("AutoMigrate err:%v", err)
    	}
    
    	// update sequence
    	err = DB.Table("events").AutoMigrate(&Event1{})
    	if err != nil {
    		t.Errorf("AutoMigrate err:%v", err)
    	}
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Mon Mar 18 11:24:16 UTC 2024
    - 56.2K bytes
    - Viewed (0)
  2. 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"}
    	p2 := CustomizedTypePrimaryKey{Name: "p2"}
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Mon Jun 24 09:42:59 UTC 2024
    - 50.4K bytes
    - Viewed (0)
Back to top