mirror of
https://github.com/silverstripe/silverstripe-mssql
synced 2024-09-30 21:29:29 +02:00
BUGFIX Make use $this->database instead of $GLOBALS['database'] which doesn't always exist.
This commit is contained in:
parent
cf26621d57
commit
7c6c3166ee
@ -72,7 +72,7 @@ class MSSQLDatabase extends Database {
|
|||||||
|
|
||||||
$result=$this->query("SELECT name FROM sys.fulltext_catalogs;");
|
$result=$this->query("SELECT name FROM sys.fulltext_catalogs;");
|
||||||
if(!$result)
|
if(!$result)
|
||||||
$this->query("CREATE FULLTEXT CATALOG {$GLOBALS['database']};");
|
$this->query("CREATE FULLTEXT CATALOG $this->database;");
|
||||||
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
@ -470,7 +470,7 @@ class MSSQLDatabase extends Database {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected function getIndexSqlDefinition($tableName, $indexName, $indexSpec) {
|
protected function getIndexSqlDefinition($tableName, $indexName, $indexSpec) {
|
||||||
|
|
||||||
if(!is_array($indexSpec)){
|
if(!is_array($indexSpec)){
|
||||||
$indexSpec=trim($indexSpec, '()');
|
$indexSpec=trim($indexSpec, '()');
|
||||||
$bits=explode(',', $indexSpec);
|
$bits=explode(',', $indexSpec);
|
||||||
@ -499,7 +499,7 @@ class MSSQLDatabase extends Database {
|
|||||||
if($result)
|
if($result)
|
||||||
$drop="DROP FULLTEXT INDEX ON \"" . $tableName . "\";";
|
$drop="DROP FULLTEXT INDEX ON \"" . $tableName . "\";";
|
||||||
|
|
||||||
return $drop . "CREATE FULLTEXT INDEX ON \"$tableName\" ({$indexSpec['value']}) KEY INDEX $primary_key ON {$GLOBALS['database']} WITH CHANGE_TRACKING AUTO;";
|
return $drop . "CREATE FULLTEXT INDEX ON \"$tableName\" ({$indexSpec['value']}) KEY INDEX $primary_key ON $this->database WITH CHANGE_TRACKING AUTO;";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -810,7 +810,7 @@ class MSSQLDatabase extends Database {
|
|||||||
* Returns the SQL command to get all the tables in this database
|
* Returns the SQL command to get all the tables in this database
|
||||||
*/
|
*/
|
||||||
function allTablesSQL(){
|
function allTablesSQL(){
|
||||||
return "SELECT name FROM {$GLOBALS['database']}..sysobjects WHERE xtype = 'U';";
|
return "SELECT name FROM $this->database..sysobjects WHERE xtype = 'U';";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user