doctrine 報錯處理辦法: Unknown database type enum requested

php app/console doctrine:schema:update --forcephp

在sf2update schema的時候 會出現一種報錯 數據庫不支持枚舉類型mysql

D:\htdocs\Symfony>php app/console doctrine:schema:update --force

  [Doctrine\DBAL\DBALException]
  Unknown database type enum requested, Doctrine\DBAL\Platforms\MySqlPlatform may not support it.sql


解決辦法數據庫

symfony2\app\config\config.yml修改一下app

doctrine:
    dbal:
        driver:   %database_driver%
        host:     %database_host%
        port:     %database_port%
        dbname:   %database_name%
        user:     %database_user%
        password: %database_password%
        charset:  UTF8
        # if using pdo_sqlite as your database driver, add the path in parameters.yml
        # e.g. database_path: %kernel.root_dir%/data/data.db3
        # path:     %database_path%
    orm:
        auto_generate_proxy_classes: %kernel.debug%
        auto_mapping: true

修改爲debug

doctrine:
    dbal:
        driver:   %database_driver%
        host:     %database_host%
        port:     %database_port%
        dbname:   %database_name%
        user:     %database_user%
        password: %database_password%
        charset:  UTF8
        # if using pdo_sqlite as your database driver, add the path in parameters.yml
        # e.g. database_path: %kernel.root_dir%/data/data.db3
        # path:     %database_path%
        mapping_types:
            enum: string
            set: string
            varbinary: string
            tinyblob: text
    orm:
        auto_generate_proxy_classes: %kernel.debug%
        auto_mapping: true

把不支持的幾個類型 enum,set等等換成 mysql經常使用的基本類型 就行了code

相關文章
相關標籤/搜索