Fix AutoMigrate, alterColumn The previous modifications were ignored#7380
Fix AutoMigrate, alterColumn The previous modifications were ignored#7380general252 wants to merge 3 commits intogo-gorm:masterfrom
AutoMigrate, alterColumn The previous modifications were ignored#7380Conversation
a631807682
left a comment
There was a problem hiding this comment.
It seems that the entire logic https://github.com/go-gorm/gorm/pull/7380/files#diff-ffbc6f3f562ac2aba57e62bedbac96edba9ad9708fe9349613bf4fa1765baf65R534-R557 does not need to be rechecked if alterColumn is true.
Please merge the commit ee3b549 of this master branch to ensure the test runs.
Yes, when When |
I means in the MigrateColumn function https://github.com/go-gorm/gorm/blob/master/migrator/migrator.go#L483-L565, when alterColumn is checked to be true, can all subsequent checks be omitted? |
I understand what you mean, and I also found that the original code has repeated checks, all of which only confirm |
|
Yes, I think this part of the duplicate check can be ignored. |
The
AutoMigratefunction, when a field in struct has adefaultvalue, modifying thesizevalue is invalid