Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 1 - 1 of 1 for TestMigrateWithUniqueIndex (0.1 seconds)

  1. tests/migrate_test.go

    		t.Fatalf("Failed to drop table, got error %v", err)
    	}
    
    	if err := DB.AutoMigrate(&UserWithIndexComment{}); err != nil {
    		t.Fatalf("Failed to auto migrate, but got error %v", err)
    	}
    }
    
    func TestMigrateWithUniqueIndex(t *testing.T) {
    	type UserWithUniqueIndex struct {
    		ID    int
    		Name  string    `gorm:"size:20;index:idx_name,unique"`
    		Date  time.Time `gorm:"index:idx_name,unique"`
    Created: Sun Apr 05 09:35:12 GMT 2026
    - Last Modified: Sat Mar 21 11:49:01 GMT 2026
    - 66.3K bytes
    - Click Count (0)
Back to Top