mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Merge pull request #2961 from ovidiupruteanu/patch-3
Sqlserver->describe failing for models with a schemaName
This commit is contained in:
commit
fda242f000
1 changed files with 3 additions and 2 deletions
|
@ -201,7 +201,8 @@ class Sqlserver extends DboSource {
|
|||
return $cache;
|
||||
}
|
||||
$fields = array();
|
||||
$table = $this->fullTableName($model, false);
|
||||
$table = $this->fullTableName($model, false, false);
|
||||
$schema = $model->schemaName;
|
||||
$cols = $this->_execute(
|
||||
"SELECT
|
||||
COLUMN_NAME as Field,
|
||||
|
@ -212,7 +213,7 @@ class Sqlserver extends DboSource {
|
|||
COLUMNPROPERTY(OBJECT_ID('" . $table . "'), COLUMN_NAME, 'IsIdentity') as [Key],
|
||||
NUMERIC_SCALE as Size
|
||||
FROM INFORMATION_SCHEMA.COLUMNS
|
||||
WHERE TABLE_NAME = '" . $table . "'"
|
||||
WHERE TABLE_NAME = '" . $table . "'" . ($schema ? " AND TABLE_SCHEMA = '" . $schema . "'" : '')
|
||||
);
|
||||
if (!$cols) {
|
||||
throw new CakeException(__d('cake_dev', 'Could not describe table for %s', $table));
|
||||
|
|
Loading…
Reference in a new issue