File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -894,16 +894,17 @@ class RequestChecker {
894894 * @returns {boolean } True if the value is
895895 */
896896 isTypeCorrect ( key , value , model ) {
897- const type = model [ key ] . type // The column type
897+ const column = model [ key ]
898+ const type = column . type // The column type
898899 if ( value === undefined || value === null ) return ! model [ key ] . notNull
899900 switch ( type ) {
900901 case 'string' :
901902 case 'varchar' :
902903 case 'time' :
903904 case 'text' :
904- return Object ( value ) instanceof String
905+ return ( Object ( value ) instanceof String ) && ( column . length !== undefined ? value . length <= column . length : true )
905906 case 'char' :
906- return ( Object ( value ) instanceof String ) && value . length === 1
907+ return ( Object ( value ) instanceof String ) && ( column . length !== undefined ? value . length <= column . length : true )
907908 case 'integer' :
908909 case 'year' :
909910 return Number . isInteger ( value )
You can’t perform that action at this time.
0 commit comments