@@ -251,7 +251,7 @@ protected function getTransfredFields(array $columns)
251
251
$ properties ['labels ' ] = $ this ->getLabel ($ column ->COLUMN_NAME );
252
252
$ properties ['is-nullable ' ] = ($ column ->IS_NULLABLE == 'YES ' );
253
253
$ properties ['data-value ' ] = $ column ->COLUMN_DEFAULT ;
254
- $ properties ['data-type ' ] = $ this ->getDataType ($ column ->DATA_TYPE );
254
+ $ properties ['data-type ' ] = $ this ->getDataType ($ column ->DATA_TYPE , $ column -> COLUMN_TYPE );
255
255
$ properties ['data-type-params ' ] = $ this ->getPrecision ($ column ->CHARACTER_MAXIMUM_LENGTH , $ column ->DATA_TYPE , $ column ->COLUMN_TYPE );
256
256
$ properties ['is-primary ' ] = ($ column ->COLUMN_KEY == 'PRIMARY KEY ' );
257
257
$ properties ['is-index ' ] = ($ column ->COLUMN_KEY == 'MUL ' );
@@ -313,13 +313,18 @@ protected function getPrecision($length, $dataType, $columnType)
313
313
* Gets the data type for a giving field.
314
314
*
315
315
* @param string $type
316
+ * @param string $columnType
316
317
*
317
318
* @return $this
318
319
*/
319
- protected function getDataType ($ type )
320
+ protected function getDataType ($ type, $ columnType )
320
321
{
321
322
$ map = Config::dataTypeMap ();
322
323
324
+ if ($ columnType == 'tinyint(1) ' ) {
325
+ return 'boolean ' ;
326
+ }
327
+
323
328
if (!array_key_exists ($ type , $ map )) {
324
329
throw new Exception ("The type " . $ type . " is not mapped in the 'eloquent_type_to_method' key in the config file. " );
325
330
}
@@ -361,7 +366,7 @@ protected function getForeignConstraint($name)
361
366
*/
362
367
protected function getHtmlOptions ($ dataType , $ columnType )
363
368
{
364
- if ($ dataType == 'tinyint(1) ' ) {
369
+ if ($ columnType == 'tinyint(1) ' ) {
365
370
return $ this ->getBooleanOptions ();
366
371
}
367
372
0 commit comments