* refactor: distinguish between UniqueIndex and Index
* add test
* add ParseIndex test
* modify unique to constraint
* modify unique to constraint
* fix MigrateColumnUnique
* fix test
* fix unit test
* update test mod
* add MigrateColumnUnique to Migrator interface
* fix format lint
* add comment
* go mod tidy
* revert: revert MigrateColumn
* resolve conflicts
* fix: 🐛 embedded struct test failed with custom datatypes
Fix the pointer embedded struct within custom datatypes and *time.time
should be nil issue.
* fix: 🐛 change test case to avoid mssql driver issue
change test cases from bytes to string to avoid mssql driver issue
* fix type alias AutoMigrate bug. eg
```go
package main
type IDer interface{ GetID() int64 }
// ID will add some method to implement some interface eg: GetID
type ID int64
func (z ID) GetID() int64 { return int64(z) }
type Test struct {
ID
Code string `gorm:"size:50"`
Name string `gorm:"size:50"`
}
func main() {
db, err := gorm.Open(postgres.New(postgres.Config{
DSN: `dsn`,
PreferSimpleProtocol: false,
}), &gorm.Config{
Logger: logger.Default.LogMode(logger.Info),
SkipDefaultTransaction: true,
})
if err != nil {
log.Fatal(err)
}
if err = db.AutoMigrate(&Test{}); err != nil {
// invalid embedded struct for Test's field ID, should be struct, but got main.ID
log.Fatal(err)
}
}
```
* fix type alias AutoMigrate bug. eg
```go
package main
type IDer interface{ GetID() int64 }
// ID will add some method to implement some interface eg: GetID
type ID int64
func (z ID) GetID() int64 { return int64(z) }
type Test struct {
ID
Code string `gorm:"size:50"`
Name string `gorm:"size:50"`
}
func main() {
db, err := gorm.Open(postgres.New(postgres.Config{
DSN: `dsn`,
PreferSimpleProtocol: false,
}), &gorm.Config{
Logger: logger.Default.LogMode(logger.Info),
SkipDefaultTransaction: true,
})
if err != nil {
log.Fatal(err)
}
if err = db.AutoMigrate(&Test{}); err != nil {
// invalid embedded struct for Test's field ID, should be struct, but got main.ID
log.Fatal(err)
}
}
```
* Add typealis test.
* try to fix golangci-lint
* optimize gormSourceDir replace
* fmt.Errorf adjust and Optimize for-break
* strings trim
* feat: avoid using the same name field and if..else optimization adjustment
* optimization callbacks/create.go Create func if...else logic
* fix: callbacks/create.go Create func
* fix FileWithLineNum func and add gormSourceDir unit test
* remove debug print and utils_filenum_test.go