【发布时间】:2018-09-26 20:28:40
【问题描述】:
我将 Doctrine DBAL 与 Zend Famework 3 一起使用,我想使用 BIT(64) 字段。 我可以看到以下支持类型: https://www.doctrine-project.org/api/dbal/2.7/Doctrine/DBAL/Types/Type.html 是否可以用BIT字段类型扩展它:https://dev.mysql.com/doc/refman/8.0/en/bit-type.html?
我需要使用权限掩码之类的东西。
下面是简单的代码:
namespace Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
class Version1 extends AbstractMigration {
/**
* Upgrades the schema to its newer state.
* @param Schema $schema
*/
public function up(Schema $schema) {
$table = $schema->createTable('user');
$table->addColumn('id', 'integer', ['autoincrement' => true, 'unsigned' => true]);
$table->addColumn('bitmask', 'bit??', []);
$table->setPrimaryKey(['id']);
$table->addOption('engine', 'InnoDB');
}
}
【问题讨论】:
标签: php doctrine-orm zend-framework3