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

Allow null to be passed as instance value #8

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

alex-friedl
Copy link

@alex-friedl alex-friedl commented Mar 26, 2018

Currently it is not possible to update a JsonField with a null value, even if allowNull is set to true.
This PR allows null to be passed as a value for instances which may be wanted when updating certain records in the database.

Also allowNull currently has no effect because the option is not passed to sequelize. This is fixed as well in this PR

@subatomicglue
Copy link

subatomicglue commented Aug 10, 2018

When will this be merged in?

We are having a bug in our production when setting the json field to null using sequelize .save() the json field then gets emptystring.

This breaks model.findAll queries, because the sequelize-json JSON.parse (in index.js) then fails with an exception.

@subatomicglue
Copy link

We have verified that this patch fixes the cases when the input is null or 'null' or ''.

Please apply this pull request, thank you!

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