Skip to content

Commit

Permalink
fix getSchemaName() for Sqlserver.
Browse files Browse the repository at this point in the history
Closes #2609.
  • Loading branch information
rchavik committed Feb 23, 2012
1 parent 55b8f66 commit b545d8b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion lib/Cake/Console/Templates/skel/Config/database.php.default
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@
* on a per-table basis with the Model::$tablePrefix property.
*
* schema =>
* For Postgres specifies which schema you would like to use the tables in. Postgres defaults to 'public'.
* For Postgres/Sqlserver specifies which schema you would like to use the tables in. Postgres defaults to 'public'. For Sqlserver, it defaults to empty and use
* the connected user's default schema (typically 'dbo').
*
* encoding =>
* For MySQL, Postgres specifies the character encoding to use when connecting to the
Expand Down
3 changes: 2 additions & 1 deletion lib/Cake/Model/Datasource/Database/Sqlserver.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ class Sqlserver extends DboSource {
'login' => '',
'password' => '',
'database' => 'cake'
'schema' => '',
);

/**
Expand Down Expand Up @@ -792,7 +793,7 @@ public function dropSchema(CakeSchema $schema, $table = null) {
* @return string The schema name
*/
public function getSchemaName() {
return $this->config['database'];
return $this->config['schema'];
}

}

0 comments on commit b545d8b

Please sign in to comment.