mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-02 21:41:19 +08:00
Fix #18845: Fix duplicating id in MigrateController::addDefaultPrimaryKey()
This commit is contained in:
@ -11,6 +11,7 @@ Yii Framework 2 Change Log
|
||||
- Enh #18762: Added `yii\helpers\Json::$keepObjectType` and `yii\web\JsonResponseFormatter::$keepObjectType` in order to avoid changing zero-indexed objects to array in `yii\helpers\Json::encode()` (zebraf1)
|
||||
- Enh #18783: Add support for URI namespaced tags in `XmlResponseFormatter` (WinterSilence, samdark)
|
||||
- Enh #18783: Add `XmlResponseFormatter::$objectTagToLowercase` option to lowercase object tags (WinterSilence, samdark)
|
||||
- Bug #18845: Fix duplicating `id` in `MigrateController::addDefaultPrimaryKey()` (WinterSilence, samdark)
|
||||
- Bug #17119: Fix `yii\caching\Cache::multiSet()` to use `yii\caching\Cache::$defaultDuration` when no duration is passed (OscarBarrett)
|
||||
|
||||
|
||||
|
||||
@ -606,7 +606,7 @@ class MigrateController extends BaseMigrateController
|
||||
protected function addDefaultPrimaryKey(&$fields)
|
||||
{
|
||||
foreach ($fields as $field) {
|
||||
if (false !== strripos($field['decorators'], 'primarykey()')) {
|
||||
if ($field['property'] === 'id' || false !== strripos($field['decorators'], 'primarykey()')) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user