php – Doctrine的addColumn()迁移方法有哪些选项?

API将代码提供为:

public function up()
{
    $this->addColumn('table_name', 'column_name', 'string', $options);
}

但是没有关于可以包含在options数组中的内容的文档.

http://www.doctrine-project.org/Doctrine_Migration_Base/1_2#method_addcolumn

解决方法:

文档错了.查看Doctrine / Migration / base.PHP,您可以看到以下函数原型:

/**
 * Add a add column change.
 *
 * @param string $tableName Name of the table
 * @param string $columnName Name of the column
 * @param string $type Type of the column
 * @param string $length Length of the column
 * @param array $options Array of options for the column
 * @return void
 */
public function addColumn($tableName, $columnName, $type, $length = null, array $options = array())

因此,要添加长度,请将其作为第4个参数.我暂时忽略了这些选项.

相关文章

统一支付是JSAPI/NATIVE/APP各种支付场景下生成支付订单,返...
统一支付是JSAPI/NATIVE/APP各种支付场景下生成支付订单,返...
前言 之前做了微信登录,所以总结一下微信授权登录并获取用户...
FastAdmin是我第一个接触的后台管理系统框架。FastAdmin是一...
之前公司需要一个内部的通讯软件,就叫我做一个。通讯软件嘛...
统一支付是JSAPI/NATIVE/APP各种支付场景下生成支付订单,返...