Laravel数据库迁移,change 方法不支持修改tinyint类型的字段属性

 执行php artisan migrate命令后,报错如下:

  Doctrine\DBAL\DBALException  : Unknown column type "tinyinteger" requested. Any Doctrine type that you use has to be registered with \Doctrine\DBAL\Types\Type::addType(). You can get a list of all the known types with \Doctrine\DBAL\Types\Type::getTypesMap(). If this error occurs during database introspection then you might have forgotten to register all database types for a Doctrine Type. Use AbstractPlatform#registerDoctrineTypeMapping() or have your custom types implement Type#getMappedDatabaseTypes(). If the type name is empty you might have a problem with the cache or forgot some mapping information.

 


// 关键代码
\Illuminate\Support\Facades\DB::statement("ALTER TABLE `cjs_shop` CHANGE `status` `status` TINYINT(3) UNSIGNED NOT NULL DEFAULT '1' COMMENT '状态, 1-正常,0-删除,2-生成订单'");

 

你可能感兴趣的:(PHP)