Skip to content
This repository
Browse code

fix getSchemaName() for Sqlserver.

Closes #2609.
  • Loading branch information...
commit b545d8b201d7add56a26c755f5e7045965abb05b 1 parent 55b8f66
Rachman Chavik authored
3  lib/Cake/Console/Templates/skel/Config/database.php.default
@@ -48,7 +48,8 @@
48 48
  * on a per-table basis with the Model::$tablePrefix property.
49 49
  *
50 50
  * schema =>
51  
- * For Postgres specifies which schema you would like to use the tables in. Postgres defaults to 'public'.
  51
+ * 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
  52
+ * the connected user's default schema (typically 'dbo').
52 53
  *
53 54
  * encoding =>
54 55
  * For MySQL, Postgres specifies the character encoding to use when connecting to the
3  lib/Cake/Model/Datasource/Database/Sqlserver.php
@@ -76,6 +76,7 @@ class Sqlserver extends DboSource {
76 76
 		'login' => '',
77 77
 		'password' => '',
78 78
 		'database' => 'cake'
  79
+		'schema' => '',
79 80
 	);
80 81
 
81 82
 /**
@@ -792,7 +793,7 @@ public function dropSchema(CakeSchema $schema, $table = null) {
792 793
  * @return string The schema name
793 794
  */
794 795
 	public function getSchemaName() {
795  
-		return $this->config['database'];
  796
+		return $this->config['schema'];
796 797
 	}
797 798
 
798 799
 }

0 notes on commit b545d8b

Please sign in to comment.
Something went wrong with that request. Please try again.