Browse Source

fixed mysql defaul integer display width on unsigned pk

fixes #11541
tags/2.0.10
Carsten Brandt 8 years ago
parent
commit
85d89e4893
  1. 1
      framework/CHANGELOG.md
  2. 2
      framework/db/mysql/QueryBuilder.php
  3. 2
      tests/framework/db/QueryBuilderTest.php

1
framework/CHANGELOG.md

@ -18,6 +18,7 @@ Yii Framework 2 Change Log
- Bug #12045: Added missing `LEVEL_PROFILE` to `yii\log\Logger::getLevelName()` map (Mak-Di)
- Bug #10681: Reverted fix of beforeValidate event calling in `yii.activeForm.js` (silverfire)
- Bug #11715: Fixed JS validation when the same model's attribute file input is listed more than once on the same page (uaoleg)
- Bug #11541: Fixed default MySQL integer display width for unsigned primary key (h311ion, rob006, cebe)
- Enh #10583: Do not silence session errors in debug mode (samdark)
- Enh #11804: Added `yii\behaviors\AttributeTypecastBehavior` for maintaining of strict ActiveRecord attribute types (klimov-paul)
- Enh #12048: Improved message extraction command performance (samdark)

2
framework/db/mysql/QueryBuilder.php

@ -24,7 +24,7 @@ class QueryBuilder extends \yii\db\QueryBuilder
*/
public $typeMap = [
Schema::TYPE_PK => 'int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY',
Schema::TYPE_UPK => 'int(11) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY',
Schema::TYPE_UPK => 'int(10) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY',
Schema::TYPE_BIGPK => 'bigint(20) NOT NULL AUTO_INCREMENT PRIMARY KEY',
Schema::TYPE_UBIGPK => 'bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY',
Schema::TYPE_CHAR => 'char(1)',

2
tests/framework/db/QueryBuilderTest.php

@ -892,7 +892,7 @@ abstract class QueryBuilderTest extends DatabaseTestCase
Schema::TYPE_UPK,
$this->primaryKey()->unsigned(),
[
'mysql' => 'int(11) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY',
'mysql' => 'int(10) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY',
'postgres' => 'serial NOT NULL PRIMARY KEY',
'sqlite' => 'integer UNSIGNED PRIMARY KEY AUTOINCREMENT NOT NULL',
],

Loading…
Cancel
Save