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

Fixing bug with mysql and default null value for not null columns #39

Conversation

manuelarte
Copy link
Collaborator

What does this do?

Which issue(s) does this PR fix/relate to?

Resolves #35

List any changes that modify/break current functionality

Have you included tests for your changes?

There are test that test the automigration gorm functionality for MySQL.

Did you document any new/modified functionality?

N/A

  • Updated example_test.go
  • Updated README.md

Notes

I removed the default:null gorm tags in the struct and added a BeforeCreate hook to check for the mandatory fields

@manuelarte manuelarte merged commit 0e03825 into main Nov 18, 2024
1 check failed
@manuelarte manuelarte deleted the 35-bug-mysql-doesnt-treat-null-as-a-valid-default-for-not-null-fields branch November 18, 2024 16:33
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.

[BUG] - MySQL doesn’t treat null as a valid default for NOT NULL fields
2 participants