return $this->fetchQueryData($sql);
}
+ /**
+ * Append an SQL statement with an index definition for a full-text search
+ * index over one or more columns on a table.
+ *
+ * @param array $statements
+ * @param string $table
+ * @param string $name
+ * @param array $def
+ */
+ function appendCreateFulltextIndex(array &$statements, $table, $name, array $def)
+ {
+ $statements[] = "CREATE FULLTEXT INDEX $name ON $table " . $this->buildIndexList($def);
+ }
+
/**
* Close out a 'create table' SQL statement.
*
return "{$tableName}_{$columnName}_idx";
}
+ /**
+ * MySQL doesn't take 'DROP CONSTRAINT', need to treat primary keys as
+ * if they were indexes here, but can use 'PRIMARY KEY' special name.
+ *
+ * @param array $phrase
+ */
+ function appendAlterDropPrimary(array &$phrase)
+ {
+ $phrase[] = 'DROP PRIMARY KEY';
+ }
/**
* MySQL doesn't take 'DROP CONSTRAINT', need to treat unique keys as
$vals = array_map(array($this, 'quote'), $column['enum']);
return 'enum(' . implode(',', $vals) . ')';
} else if ($this->_isString($column)) {
- return parent::typeAndSize($column) . ' CHARSET utf8';
+ $col = parent::typeAndSize($column);
+ if (!empty($column['charset'])) {
+ $col .= ' CHARSET ' . $column['charset'];
+ }
+ if (!empty($column['collate'])) {
+ $col .= ' COLLATE ' . $column['collate'];
+ }
+ return $col;
} else {
return parent::typeAndSize($column);
}