Skip to content

Commit

Permalink
Fix undefined index notice for model indexes
Browse files Browse the repository at this point in the history
  • Loading branch information
hansek committed Sep 28, 2015
1 parent 0312a6f commit 1ca8ed6
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions xpdo/om/mysql/xpdomanager.class.php
Expand Up @@ -457,9 +457,13 @@ protected function getColumnDef($class, $name, $meta, array $options = array())
protected function getIndexDef($class, $name, $meta, array $options = array()) {
$result = '';
if (isset($meta['type']) && $meta['type'] == 'FULLTEXT') {
$indexType = "FULLTEXT";
$indexType = 'FULLTEXT';
} else if ( ! empty($meta['primary'])) {
$indexType = 'PRIMARY KEY';
} else if ( ! empty($meta['unique'])) {
$indexType = 'UNIQUE KEY';
} else {
$indexType = ($meta['primary'] ? 'PRIMARY KEY' : ($meta['unique'] ? 'UNIQUE KEY' : 'INDEX'));
$indexType = 'INDEX';
}
$index = $meta['columns'];
if (is_array($index)) {
Expand Down

0 comments on commit 1ca8ed6

Please sign in to comment.