-
-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix AutoMigrate
, alterColumn The previous modifications were ignored
#7380
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
AutoMigrate
function, when a field in struct has adefault
value, modifying thesize
value is invalid