Merge pull request #42 from ajoneil/1

Fix index issues in /dev/build
This commit is contained in:
Sean Harvey 2017-02-13 08:39:51 +13:00 committed by GitHub
commit 761b42f24a

View File

@ -606,7 +606,10 @@ class MSSQLSchemaManager extends DBSchemaManager
$drop = "IF EXISTS (SELECT name FROM sys.indexes WHERE name = '$index') DROP INDEX $index ON \"$tableName\";"; $drop = "IF EXISTS (SELECT name FROM sys.indexes WHERE name = '$index') DROP INDEX $index ON \"$tableName\";";
// create a type-specific index // 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 // enable fulltext on this table
$this->createFullTextCatalog(); $this->createFullTextCatalog();
$primary_key = $this->getPrimaryKey($tableName); $primary_key = $this->getPrimaryKey($tableName);
@ -695,7 +698,7 @@ class MSSQLSchemaManager extends DBSchemaManager
return $this->preparedQuery(' return $this->preparedQuery('
SELECT ind.name FROM sys.indexes ind SELECT ind.name FROM sys.indexes ind
INNER JOIN sys.tables t ON ind.object_id = t.object_id 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) array($tableName)
)->column(); )->column();
} }