2010-02-17 23 views

回答

1

該文檔是錯誤的。展望主義/遷移/ 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()) 

所以要加長度,你給它的第四個參數。我忽略了目前的選擇。

0

繼頂部的「瀏覽代碼」鏈接,你可以按照Doctrine_Migration_Base::column()代碼$options['length']Doctrine_Migration_Base::_addChange()第二個參數。查看源代碼不時,它給你一個概述:)

+0

我搜遍了他們的代碼,因爲缺少文檔,但仍未找到任何選項或者Doctrine會允許哪些選項。當我嘗試將128或'notnull'的'length'添加爲true時,這些值將被忽略。 – rxgx 2010-03-10 23:02:01