I think something is not yet implemented.
If you look at the source on addColumn , you will see that it is looking for the identity/auto_increment parameter and sets the IDENTITY attribute in the internal representation of the column.
#File: lib/Varien/Db/Ddl/Table.php if (!empty($options['identity']) || !empty($options['auto_increment'])) { $identity = true; } $upperName = strtoupper($name); $this->_columns[$upperName] = array( 'COLUMN_NAME' => $name, 'COLUMN_TYPE' => $type, 'COLUMN_POSITION' => $position, 'DATA_TYPE' => $type, 'DEFAULT' => $default, 'NULLABLE' => $nullable, 'LENGTH' => $length, 'SCALE' => $scale, 'PRECISION' => $precision, 'UNSIGNED' => $unsigned, 'PRIMARY' => $primary, 'PRIMARY_POSITION' => $primaryPosition, 'IDENTITY' => $identity );
However, if you look at the createTable method on the connection object
#File: lib/Varien/Db/Adapter/Pdo/Mysql.php public function createTable(Varien_Db_Ddl_Table $table) { $sqlFragment = array_merge( $this->_getColumnsDefinition($table), $this->_getIndexesDefinition($table), $this->_getForeignKeysDefinition($table) ); $tableOptions = $this->_getOptionsDefination($table); $sql = sprintf("CREATE TABLE %s (\n%s\n) %s", $this->quoteIdentifier($table->getName()), implode(",\n", $sqlFragment), implode(" ", $tableOptions)); return $this->query($sql); }
you can see _getColumnsDefinition , _getIndexesDefinition and _getForeignKeysDefinition to create a CREATE SQL fragment. None of these methods refer to IDENTITY or auto_increment , and they do not generate any sql that would create an automatic increment.
The only possible candidates in this class are
/** * Autoincrement for bind value * * @var int */ protected $_bindIncrement = 0;
which is used to control the increment number for the associated PDO parameter (nothing to do with auto_increment ).
Auto_increment is also mentioned here.
protected function _getOptionsDefination(Varien_Db_Ddl_Table $table) { $definition = array(); $tableProps = array( 'type' => 'ENGINE=%s', 'checksum' => 'CHECKSUM=%d', 'auto_increment' => 'AUTO_INCREMENT=%d', 'avg_row_length' => 'AVG_ROW_LENGTH=%d', 'comment' => 'COMMENT=\'%s\'', 'max_rows' => 'MAX_ROWS=%d', 'min_rows' => 'MIN_ROWS=%d', 'delay_key_write' => 'DELAY_KEY_WRITE=%d', 'row_format' => 'row_format=%s', 'charset' => 'charset=%s', 'collate' => 'COLLATE=%s' ); foreach ($tableProps as $key => $mask) { $v = $table->getOption($key); if (!is_null($v)) { $definition[] = sprintf($mask, $v); } } return $definition; }
but this is used to handle the options set in the table . This auto_increment controls the parameters of the auto_increment table that can be used to control the integer a of auto_increment .