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

Issue #158 SQLite fields are nullible unless NOT NULL #159

Merged

Conversation

ChrisPortman
Copy link
Contributor

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

What did this pull request do?

This change sets the default value of ColumnType.Nullable() to true.
If the column is explicitly NOT NULL then it will be set false.

This is consistent with the SQLite documentation:
https://www.sqlitetutorial.net/sqlite-not-null-constraint/

User Case Description

Correct reporting of nullable state for a column that does not specify NULL explicitly

This change sets the default value of ColumnType.Nullable() to true.  If
the column is explicitly `MOT NULL` then it will be set false.

This is consistent with the SQLite documentation:
https://www.sqlitetutorial.net/sqlite-not-null-constraint/
@jinzhu jinzhu merged commit 74475fc into go-gorm:master Oct 8, 2023
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.

2 participants