File tree 1 file changed +19
-1
lines changed
1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -164,7 +164,25 @@ SQLConnector.prototype.addPropertyToActual = function(model, propName) {
164
164
} ;
165
165
166
166
SQLConnector . prototype . columnDataType = function ( model , property ) {
167
- throw new Error ( g . f ( '{{columnDataType()}} must be implemented by the connector' ) ) ;
167
+ var columnMetadata = this . columnMetadata ( model , property ) ;
168
+ var colType = columnMetadata && columnMetadata . dataType ;
169
+ if ( colType ) {
170
+ colType = colType . toUpperCase ( ) ;
171
+ }
172
+ var prop = this . getModelDefinition ( model ) . properties [ property ] ;
173
+ if ( ! prop ) {
174
+ return null ;
175
+ }
176
+ var colLength = columnMetadata && columnMetadata . dataLength ||
177
+ prop . length || prop . limit ;
178
+ if ( colType && colLength ) {
179
+ return colType + '(' + colLength + ')' ;
180
+ }
181
+ return this . buildColumnType ( prop ) ;
182
+ } ;
183
+
184
+ SQLConnector . prototype . buildColumnType = function ( property ) {
185
+ throw new Error ( g . f ( '{{buildColumnType()}} must be implemented by the connector' ) ) ;
168
186
} ;
169
187
170
188
SQLConnector . prototype . propertyHasNotBeenDeleted = function ( model , propName ) {
You can’t perform that action at this time.
0 commit comments