Browse Source

MSSQL AR tests.

tags/2.0.0-beta
resurtm 12 years ago
parent
commit
2430ebe95d
  1. 7
      framework/yii/db/mssql/Schema.php
  2. 12
      tests/unit/framework/db/mssql/MssqlActiveRecordTest.php

7
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];
}
}
/**

12
tests/unit/framework/db/mssql/MssqlActiveRecordTest.php

@ -0,0 +1,12 @@
<?php
namespace yiiunit\framework\db\mssql;
class MssqlActiveRecordTest extends \yiiunit\framework\db\ActiveRecordTest
{
protected function setUp()
{
$this->driverName = 'sqlsrv';
parent::setUp();
}
}
Loading…
Cancel
Save