Skip to content
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: migrate column default value #5359

Merged
merged 2 commits into from May 28, 2022

Conversation

a631807682
Copy link
Member

@a631807682 a631807682 commented May 21, 2022

  • Do only one thing
  • Non breaking API changes
  • Tested

What did this pull request do?

relate to #5325 and go-gorm/mysql#75

mariadb test will pass after go-gorm/mysql#75 merged

User Case Description

@jinzhu jinzhu merged commit 93986de into go-gorm:master May 28, 2022
@sc-ms
Copy link

sc-ms commented May 29, 2022

Hey, I saw your fix but in my case I have for
dv, dvNotNull := columnType.DefaultValue()
these values:
dv: "NULL"
dvNotNull: true

So it has alterColumn = true but in migrator it doesn't change the column.

@a631807682
Copy link
Member Author

@sc-ms can you provide an example?

@a631807682 a631807682 deleted the fix_migrate_default branch May 29, 2022 14:51
@sc-ms
Copy link

sc-ms commented May 29, 2022

I found the reason why it didn't work for me.
I noticed it while creating an example.
I had still used gorm.io/driver/mysql in v1.3.3.
But with v1.3.4 it works correctly.

Please excuse me for the confusion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants