Skip to content
This repository has been archived by the owner on Dec 20, 2023. It is now read-only.

Do not typecast empty string to null for columns of type text #146

Merged
merged 3 commits into from
Jun 7, 2016

Conversation

aheuermann
Copy link
Contributor

@aheuermann aheuermann commented Jun 6, 2016

Currently it is not possible to save an empty string to a text type field unless you set typecastEmptyStringToNull: false (it defaults to true). In this case string is varchar so I am assuming text was just left out. Let me know what you think.

@aheuermann aheuermann changed the title Do not typecast text to null Do not typecast empty string to null for columns of type text Jun 6, 2016
@aheuermann aheuermann force-pushed the text_empty_string_fix branch 2 times, most recently from 9f3a749 to 47896d6 Compare June 7, 2016 13:56
@dustinsmith1024
Copy link
Contributor

All the other repo's fail on node 6 as well, so as long as 4/5 pass then it's probably okay.

this.primaryKey("id");
this[underscore ? "text_type" : "texttype"]("text", {allowNull: false});
this[underscore ? "blob_type" : "blobtype"]("blob", {allowNull: false});
});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is 'string' case covered?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added tests for the other types

@aheuermann aheuermann merged commit 8aa5297 into master Jun 7, 2016
@aheuermann aheuermann deleted the text_empty_string_fix branch June 7, 2016 15:02
jonstacks pushed a commit to jonstacks/patio that referenced this pull request Feb 24, 2019
Do not typecast empty string to null for columns of type text
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants