Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix FULLTEXT column generation

Fixes #3618
  • Loading branch information...
commit 0d9ef854ff6633e97adaaba41efcef30a6395274 1 parent e0a9dd8
@markstory markstory authored
View
5 lib/Cake/Model/Datasource/Database/Mysql.php
@@ -586,8 +586,11 @@ public function buildIndex($indexes, $table = null) {
}
$name = $this->startQuote . $name . $this->endQuote;
}
- // length attribute only used for MySQL datasource, for TEXT/BLOB index columns
+ if (isset($value['type']) && strtolower($value['type']) === 'fulltext') {
+ $out .= 'FULLTEXT ';
+ }
$out .= 'KEY ' . $name . ' (';
+
if (is_array($value['column'])) {
if (isset($value['length'])) {
$vals = array();
View
2  lib/Cake/Model/Datasource/DboSource.php
@@ -3170,8 +3170,6 @@ public function buildIndex($indexes, $table = null) {
} else {
if (!empty($value['unique'])) {
$out .= 'UNIQUE ';
- } elseif (!empty($value['type']) && strtoupper($value['type']) === 'FULLTEXT') {
- $out .= 'FULLTEXT ';
}
$name = $this->startQuote . $name . $this->endQuote;
}
View
1  lib/Cake/Test/Case/Model/Datasource/Database/MysqlTest.php
@@ -2984,6 +2984,7 @@ public function testBuildIndex() {
);
$result = $this->Dbo->buildIndex($data);
$expected = array('FULLTEXT KEY `MyFtIndex` (`name`, `description`)');
+ $this->assertEquals($expected, $result);
$data = array(
'MyTextIndex' => array('column' => 'text_field', 'length' => array('text_field' => 20))
Please sign in to comment.
Something went wrong with that request. Please try again.