Browse Source

Reverted 0bf2dad: it's very common to use lower case for column types and upper case for other DB keywords.

tags/2.0.0-beta
Qiang Xue 11 years ago
parent
commit
6fe152da7e
  1. 2
      framework/yii/db/cubrid/QueryBuilder.php
  2. 2
      framework/yii/db/mssql/QueryBuilder.php
  3. 2
      framework/yii/db/mysql/QueryBuilder.php
  4. 2
      framework/yii/db/pgsql/QueryBuilder.php
  5. 2
      framework/yii/db/sqlite/QueryBuilder.php
  6. 1
      tests/unit/framework/db/sqlite/SqliteQueryBuilderTest.php

2
framework/yii/db/cubrid/QueryBuilder.php

@ -21,7 +21,7 @@ class QueryBuilder extends \yii\db\QueryBuilder
* @var array mapping from abstract column types (keys) to physical column types (values). * @var array mapping from abstract column types (keys) to physical column types (values).
*/ */
public $typeMap = array( public $typeMap = array(
Schema::TYPE_PK => 'int not null auto_increment primary key', Schema::TYPE_PK => 'int NOT NULL AUTO_INCREMENT PRIMARY KEY',
Schema::TYPE_STRING => 'varchar(255)', Schema::TYPE_STRING => 'varchar(255)',
Schema::TYPE_TEXT => 'varchar', Schema::TYPE_TEXT => 'varchar',
Schema::TYPE_SMALLINT => 'smallint', Schema::TYPE_SMALLINT => 'smallint',

2
framework/yii/db/mssql/QueryBuilder.php

@ -21,7 +21,7 @@ class QueryBuilder extends \yii\db\QueryBuilder
* @var array mapping from abstract column types (keys) to physical column types (values). * @var array mapping from abstract column types (keys) to physical column types (values).
*/ */
public $typeMap = array( public $typeMap = array(
Schema::TYPE_PK => 'int identity primary key', Schema::TYPE_PK => 'int IDENTITY PRIMARY KEY',
Schema::TYPE_STRING => 'varchar(255)', Schema::TYPE_STRING => 'varchar(255)',
Schema::TYPE_TEXT => 'text', Schema::TYPE_TEXT => 'text',
Schema::TYPE_SMALLINT => 'smallint(6)', Schema::TYPE_SMALLINT => 'smallint(6)',

2
framework/yii/db/mysql/QueryBuilder.php

@ -22,7 +22,7 @@ class QueryBuilder extends \yii\db\QueryBuilder
* @var array mapping from abstract column types (keys) to physical column types (values). * @var array mapping from abstract column types (keys) to physical column types (values).
*/ */
public $typeMap = array( public $typeMap = array(
Schema::TYPE_PK => 'int(11) not null auto_increment primary key', Schema::TYPE_PK => 'int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY',
Schema::TYPE_STRING => 'varchar(255)', Schema::TYPE_STRING => 'varchar(255)',
Schema::TYPE_TEXT => 'text', Schema::TYPE_TEXT => 'text',
Schema::TYPE_SMALLINT => 'smallint(6)', Schema::TYPE_SMALLINT => 'smallint(6)',

2
framework/yii/db/pgsql/QueryBuilder.php

@ -21,7 +21,7 @@ class QueryBuilder extends \yii\db\QueryBuilder
* @var array mapping from abstract column types (keys) to physical column types (values). * @var array mapping from abstract column types (keys) to physical column types (values).
*/ */
public $typeMap = array( public $typeMap = array(
Schema::TYPE_PK => 'serial not null primary key', Schema::TYPE_PK => 'serial NOT NULL PRIMARY KEY',
Schema::TYPE_STRING => 'varchar(255)', Schema::TYPE_STRING => 'varchar(255)',
Schema::TYPE_TEXT => 'text', Schema::TYPE_TEXT => 'text',
Schema::TYPE_SMALLINT => 'smallint', Schema::TYPE_SMALLINT => 'smallint',

2
framework/yii/db/sqlite/QueryBuilder.php

@ -23,7 +23,7 @@ class QueryBuilder extends \yii\db\QueryBuilder
* @var array mapping from abstract column types (keys) to physical column types (values). * @var array mapping from abstract column types (keys) to physical column types (values).
*/ */
public $typeMap = array( public $typeMap = array(
Schema::TYPE_PK => 'integer primary key autoincrement not null', Schema::TYPE_PK => 'integer PRIMARY KEY AUTOINCREMENT NOT NULL',
Schema::TYPE_STRING => 'varchar(255)', Schema::TYPE_STRING => 'varchar(255)',
Schema::TYPE_TEXT => 'text', Schema::TYPE_TEXT => 'text',
Schema::TYPE_SMALLINT => 'smallint', Schema::TYPE_SMALLINT => 'smallint',

1
tests/unit/framework/db/sqlite/SqliteQueryBuilderTest.php

@ -2,7 +2,6 @@
namespace yiiunit\framework\db\sqlite; namespace yiiunit\framework\db\sqlite;
use yii\base\NotSupportedException;
use yii\db\sqlite\Schema; use yii\db\sqlite\Schema;
use yiiunit\framework\db\QueryBuilderTest; use yiiunit\framework\db\QueryBuilderTest;

Loading…
Cancel
Save