Skip to content

Commit

Permalink
Merge pull request #21 from Sensetivity/master
Browse files Browse the repository at this point in the history
Added syntax for adding fulltext indexes. Thank you
  • Loading branch information
c006 authored Nov 1, 2016
2 parents 33deea7 + fdc16fc commit a7455e7
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion controllers/DefaultController.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ public function actionIndex()
'unique' => (($item['Non_unique']) ? 0 : 1),
'column' => $item['Column_name'],
'table' => $item['Table'],
'fulltext' => $item['Index_type'] == 'FULLTEXT' ? 1 : 0,
];
}
}
Expand Down Expand Up @@ -182,7 +183,11 @@ public function actionIndex()
if (sizeof($array['indexes'])) {
$output->addStr(' ');
foreach ($array['indexes'] as $item) {
$str = '$this->createIndex(\'' . $item['name'] . '\',\'' . $item['table'] . '\',\'' . $item['column'] . '\',' . $item['unique'] . ');';
if ($item['fulltext']) {
$str = '$this->execute("ALTER TABLE ' . $item['table'] . ' ADD FULLTEXT INDEX ' . $item['name'] . ' (' . $item['column'] . ')");';
} else {
$str = '$this->createIndex(\'' . $item['name'] . '\',\'' . $item['table'] . '\',\'' . $item['column'] . '\',' . $item['unique'] . ');';
}
$output->addStr($str);
}
}
Expand Down

0 comments on commit a7455e7

Please sign in to comment.