Skip to content

Commit

Permalink
Merge pull request #42 from ajoneil/1
Browse files Browse the repository at this point in the history
Fix index issues in /dev/build
  • Loading branch information
Sean Harvey authored Feb 12, 2017
2 parents f3574a6 + d9ec128 commit 761b42f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions code/MSSQLSchemaManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -606,7 +606,10 @@ protected function getIndexSqlDefinition($tableName, $indexName, $indexSpec)
$drop = "IF EXISTS (SELECT name FROM sys.indexes WHERE name = '$index') DROP INDEX $index ON \"$tableName\";";

// create a type-specific index
if ($indexSpec['type'] == 'fulltext' && $this->database->fullTextEnabled()) {
if ($indexSpec['type'] == 'fulltext') {
if(!$this->database->fullTextEnabled()) {
return '';
}
// enable fulltext on this table
$this->createFullTextCatalog();
$primary_key = $this->getPrimaryKey($tableName);
Expand Down Expand Up @@ -695,7 +698,7 @@ public function indexNames($tableName)
return $this->preparedQuery('
SELECT ind.name FROM sys.indexes ind
INNER JOIN sys.tables t ON ind.object_id = t.object_id
WHERE is_primary_key = 0 AND t.name = ?',
WHERE is_primary_key = 0 AND t.name = ? AND ind.name IS NOT NULL',
array($tableName)
)->column();
}
Expand Down

0 comments on commit 761b42f

Please sign in to comment.