Here is the original question:
I have an instance of Sequelize with the flag omitNull to insert de defaultValues defined in the DB if i do not define them in the create method of a model. Like this:
var sequelize = new Sequelize('db', 'user', 'pw', {omitNull: true})But I want to insert null values in other models if I define them as null. Like:
SomeModel.create({some_property: null});Is there a way to define the omitNull property just for some properties of a model?
When using omitNull=true option there is a way to force sequelize to set a property null.
Just do something like this:
SomeModel.some_property = nulll;
SomeModel.save(['some_property']);This will force sequelize to create the update/insert SQL with NULL for "some_property".
I agree omiNull is not the best solution. I hope sequelize team solves this problem soon. =)