From: Chuck Hagenbuch Date: Tue, 23 Dec 2008 19:03:42 +0000 (-0500) Subject: notes on mssql needing nchar for unicode strings X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=030998ebc2c1d2841b75fe30282650bb80f65a37;p=horde.git notes on mssql needing nchar for unicode strings --- diff --git a/framework/Db/lib/Horde/Db/Adapter/Mssql/Schema.php b/framework/Db/lib/Horde/Db/Adapter/Mssql/Schema.php index 1a88aaca4..80495d516 100644 --- a/framework/Db/lib/Horde/Db/Adapter/Mssql/Schema.php +++ b/framework/Db/lib/Horde/Db/Adapter/Mssql/Schema.php @@ -36,9 +36,38 @@ class Horde_Db_Adapter_Mssql_Schema extends Horde_Db_Adapter_Abstract_Schema } + /*########################################################################## + # Schema Statements + ##########################################################################*/ + + /** + * The db column types for this adapter + * + * @return array + */ + public function nativeDatabaseTypes() + { + return array( + /* TODO, just put in nchar for unicode strings */ + 'primaryKey' => 'int(11) DEFAULT NULL auto_increment PRIMARY KEY', + 'string' => array('name' => 'nchar', 'limit' => 255), + 'text' => array('name' => 'text', 'limit' => null), + 'integer' => array('name' => 'int', 'limit' => 11), + 'float' => array('name' => 'float', 'limit' => null), + 'decimal' => array('name' => 'decimal', 'limit' => null), + 'datetime' => array('name' => 'datetime', 'limit' => null), + 'timestamp' => array('name' => 'datetime', 'limit' => null), + 'time' => array('name' => 'time', 'limit' => null), + 'date' => array('name' => 'date', 'limit' => null), + 'binary' => array('name' => 'blob', 'limit' => null), + 'boolean' => array('name' => 'tinyint', 'limit' => 1), + ); + } + + /** */ - public function getTables() + public function tables() { return 'SELECT name FROM sysobjects WHERE type = \'U\' ORDER BY name'; }