laravel Doctrine\DBAL\DBALException : Unknown database type geometry requested

在laravel中用Schema获取数据库表信息时,报错:

Doctrine\DBAL\DBALException : Unknown database type geometry requested, Doctrine\DBAL\Platforms\MySQL57Platform may not support it.

tips:意思是说Doctrine mysql5.7对geometry数据类型不支持

解决方法:

use Illuminate\Support\Facades\Schema;

$schema = Schema::getConnection()->getDoctrineSchemaManager();

$schema->getDatabasePlatform()->registerDoctrineTypeMapping('geometry', 'string');

你可能感兴趣的:(laravel Doctrine\DBAL\DBALException : Unknown database type geometry requested)