1
我們在\Doctrine\DBal\Types\Type::addType()
上添加了一個名爲enumFooType
的枚舉的列類型。刪除列時使用原則遷移
當運行vendor/bin/doctrine-module migrations:diff
產生遷移,將刪除該列,被拋出了一個錯誤:
[Doctrine\DBAL\DBALException]
Unknown column type "enumFooType" 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 forgot 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.
我猜測拋出的錯誤,因爲該數據庫有標有(DC2Type:enumFooType)
一個foo_type
。
處理這些刪除類型的正確方法是什麼?我的第一個想法是使用vendor/bin/doctrine-module migrations:generate
生成空白遷移並手動編寫查詢,但我希望採用更自動化的方式,如果可能的話不要手動編寫任何內容。