Laravel db migration - renameColumn error - Unknown database type enum requested

前端 未结 8 872
暗喜
暗喜 2020-12-10 11:53

I am using Laravel 4.2. I have the following library loaded in my composer.json

\"doctrine/dbal\": \"2.4.*\",

I c

8条回答
  •  余生分开走
    2020-12-10 11:59

    You can add custom constructor to migration and explain to Doctrine that enum should be treated like string.

    public function __construct(\Doctrine\DBAL\Migrations\Version $version)
    {
        parent::__construct($version);
    
        $this->platform->registerDoctrineTypeMapping('enum', 'string');
    }
    

提交回复
热议问题