Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

Merged
jinzhu merged 1 commit intogo-gorm:masterfrom
ChrisPortman:issue-158-nullable-default-true
Oct 8, 2023
Merged

Issue #158 SQLite fields are nullible unless NOT NULL#159
jinzhu merged 1 commit intogo-gorm:masterfrom
ChrisPortman:issue-158-nullable-default-true

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