diff --git a/framework/yii/db/mssql/Schema.php b/framework/yii/db/mssql/Schema.php index f37ae8f..c52dfc3 100644 --- a/framework/yii/db/mssql/Schema.php +++ b/framework/yii/db/mssql/Schema.php @@ -290,13 +290,6 @@ SQL; $table->primaryKey = $this->db ->createCommand($sql, array(':tableName' => $table->name, ':schemaName' => $table->schemaName)) ->queryColumn(); - if (count($table->primaryKey) == 0) { - // table does not have primary key - $table->primaryKey = null; - } elseif (count($table->primaryKey) == 1) { - // table has one primary key - $table->primaryKey = $table->primaryKey[0]; - } } /** diff --git a/tests/unit/framework/db/mssql/MssqlActiveRecordTest.php b/tests/unit/framework/db/mssql/MssqlActiveRecordTest.php new file mode 100644 index 0000000..2cf0b01 --- /dev/null +++ b/tests/unit/framework/db/mssql/MssqlActiveRecordTest.php @@ -0,0 +1,12 @@ +driverName = 'sqlsrv'; + parent::setUp(); + } +}