Skip to content

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