Builds the name for an index.
/** * Builds the name for an index. * * Cuts the index name to the maximum length of 30 characters limited by * Oracle. * * @param string $tableName A table name. * @param string|array $options Either a column name or index options: * - column: (string|array) column name(s). * - name: (string) the index name to fall * back to if no column names specified. */ public function indexName($tableName, $options = array()) { $index = parent::indexName($tableName, $options); if (strlen($index) <= 30) { return $index; } if (isset($options['name']) && $index == $options['name']) { return $this->_truncate($index); } return substr('ind_' . $this->_truncate($tableName, 15) . '_' . hash('crc32', $index), 0, 30); }
/** * Builds the name for an index. * * Cuts the index name to the maximum length of 64 characters limited by * MySQL. * * @param string $tableName A table name. * @param string|array $options Either a column name or index options: * - column: (string|array) column name(s). * - name: (string) the index name to fall * back to if no column names specified. */ public function indexName($tableName, $options = array()) { return substr(parent::indexName($tableName, $options), 0, 64); }