Refactored Large Functions: Broke down large functions into smaller, more manageable ones for better readability and maintainability.
Enhanced Error Handling: Added more descriptive error messages and ensured all potential errors are properly checked and handled.
Simplified Complex Logic: Streamlined complex conditional statements and loops to make the code easier to understand.
Go Best Practices: Ensured the code follows Go conventions, such as proper naming, commenting, and structuring.
Removed Redundancies: Eliminated any redundant code or unnecessary variables to optimize performance.
Consistent Formatting: Applied consistent code formatting for better readability.
* 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: remove uuid autoincrement
* AutoMigrate() should always migrate checks, even there is no relationship constranits.
Co-authored-by: a631807682 <631807682@qq.com>
* feat(migrator,migrator/migrator.go,tests/migrate_test.go) : Get multiple data tables for migrator.
* feat(migrator.go and migrator/migrator.go) : remove Table Struct replace with []string
* fix(migrator) : Return all data tables
* Update migrator.go
* fix(migrator/migrator.go):remove var sql
* feat(migrate_test.go/go.mod):update sqlserver,sqlite,postgres,pq version and add getTables test
* fix(migrate_test.go):change GetTables Method Test,use intersection
Co-authored-by: dino.ma <mashengjie03@baidu.com>
* Refactor ParseWithSchemaTable method and improve test.
* Fix schema.ParseWithSchemaTable method for only use schemaTable in migrator and improve test.
* Rename `schemaTable` to `specialTableName` for clearly argument.
* 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