mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
parent
e0a9dd81f8
commit
0d9ef854ff
3 changed files with 5 additions and 3 deletions
|
@ -586,8 +586,11 @@ class Mysql extends DboSource {
|
|||
}
|
||||
$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();
|
||||
|
|
|
@ -3170,8 +3170,6 @@ class DboSource extends DataSource {
|
|||
} else {
|
||||
if (!empty($value['unique'])) {
|
||||
$out .= 'UNIQUE ';
|
||||
} elseif (!empty($value['type']) && strtoupper($value['type']) === 'FULLTEXT') {
|
||||
$out .= 'FULLTEXT ';
|
||||
}
|
||||
$name = $this->startQuote . $name . $this->endQuote;
|
||||
}
|
||||
|
|
|
@ -2984,6 +2984,7 @@ class MysqlTest extends CakeTestCase {
|
|||
);
|
||||
$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))
|
||||
|
|
Loading…
Reference in a new issue