From 89e3077108605a4b27bf195fbcf7d7ef2a54ea08 Mon Sep 17 00:00:00 2001 From: resurtm Date: Fri, 24 May 2013 00:06:40 +0600 Subject: [PATCH] MSSQL column case consistency. --- framework/yii/db/mssql/Schema.php | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/framework/yii/db/mssql/Schema.php b/framework/yii/db/mssql/Schema.php index add6185..1991542 100644 --- a/framework/yii/db/mssql/Schema.php +++ b/framework/yii/db/mssql/Schema.php @@ -156,14 +156,14 @@ class Schema extends \yii\db\Schema { $column = new ColumnSchema(); - $column->name = $info['COLUMN_NAME']; - $column->allowNull = $info['IS_NULLABLE'] == 'YES'; - $column->dbType = $info['DATA_TYPE']; + $column->name = $info['column_name']; + $column->allowNull = $info['is_nullable'] == 'YES'; + $column->dbType = $info['data_type']; $column->enumValues = array(); // mssql has only vague equivalents to enum $column->isPrimaryKey = null; // primary key will be determined in findColumns() method - $column->autoIncrement = $info['IsIdentity'] == 1; + $column->autoIncrement = $info['is_identity'] == 1; $column->unsigned = stripos($column->dbType, 'unsigned') !== false; - $column->comment = $info['Comment'] === null ? '' : $info['Comment']; + $column->comment = $info['comment'] === null ? '' : $info['comment']; $column->type = self::TYPE_STRING; if (preg_match('/^(\w+)(?:\(([^\)]+)\))?/', $column->dbType, $matches)) { @@ -191,11 +191,11 @@ class Schema extends \yii\db\Schema $column->phpType = $this->getColumnPhpType($column); - if ($info['COLUMN_DEFAULT'] == '(NULL)') { - $info['COLUMN_DEFAULT'] = null; + if ($info['column_default'] == '(NULL)') { + $info['column_default'] = null; } - if ($column->type !== 'timestamp' || $info['COLUMN_DEFAULT'] !== 'CURRENT_TIMESTAMP') { - $column->defaultValue = $column->typecast($info['COLUMN_DEFAULT']); + if ($column->type !== 'timestamp' || $info['column_default'] !== 'CURRENT_TIMESTAMP') { + $column->defaultValue = $column->typecast($info['column_default']); } return $column; @@ -221,9 +221,9 @@ class Schema extends \yii\db\Schema $sql = <<