我正在使用带有 ZF2 的 Doctrine 2 ORM。
/**
*
* @ORM\Column(type="tinyint", options={"default" = 1})
*/
protected $isActive;
我如何创建 tinyint 类型的列,正如我在支持数据类型的教义中看到的那样,它不存在。
Commandline># ./vendor/bin/doctrine-module orm:validate-schema
[Mapping] FAIL - The entity-class 'Application\Entity\User' mapping is invalid:
* The field 'Application\Entity\User#isActive' uses a non-existant type 'tinyint'.
[Doctrine\DBAL\DBALException]
Unknown column type "tinyint" 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::getTypeMap(). 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#getMappedDatabaseT
ypes(). If the type name is empty you might have a problem with the cache or forgot some mapping information.
orm:validate-schema