Browse Source

Fix #12423 Fix bug migration tool when creating fields with brackets in comment

tags/2.0.10
Daniel Gomez Pan 8 years ago
parent
commit
ae42d7b281
  1. 1
      framework/CHANGELOG.md
  2. 2
      framework/console/controllers/MigrateController.php
  3. 1
      tests/data/console/migrate_create/create_fields.php
  4. 3
      tests/framework/console/controllers/MigrateControllerTestTrait.php

1
framework/CHANGELOG.md

@ -16,6 +16,7 @@ Yii Framework 2 Change Log
- Enh #10583: Do not silence session errors in debug mode (samdark)
- Enh #12048: Improved message extraction command performance (samdark)
- Enh #12038: Introduced `yii\base\ViewNotFoundException` which is thrown when views file doesn't exists, used it in `ViewAction` (samdark)
- Bug #12423: Fixed bug migration tool when creating fields with brackets in comment
2.0.9 July 11, 2016
-------------------

2
framework/console/controllers/MigrateController.php

@ -351,7 +351,7 @@ class MigrateController extends BaseMigrateController
continue;
}
if (!preg_match('/^(.+?)\(([^)]+)\)$/', $chunk)) {
if (!preg_match('/^(.+?)\(([^(]+)\)$/', $chunk)) {
$chunk .= '()';
}
}

1
tests/data/console/migrate_create/create_fields.php

@ -20,6 +20,7 @@ class {$class} extends Migration
'title' => \$this->string(10)->notNull()->unique()->defaultValue("test"),
'body' => \$this->text()->notNull(),
'price' => \$this->money(11,2)->notNull(),
'parenthesis_in_comment' => \$this->string(255)->notNull()->comment('Name of set (RU)'),
]);
}

3
tests/framework/console/controllers/MigrateControllerTestTrait.php

@ -203,7 +203,8 @@ CODE;
$this->assertCommandCreatedFile('create_fields', $migrationName, [
'fields' => 'title:string(10):notNull:unique:defaultValue("test"),
body:text:notNull,
price:money(11,2):notNull'
price:money(11,2):notNull,
parenthesis_in_comment:string(255):notNull:comment(\'Name of set (RU)\')'
]);
$this->assertCommandCreatedFile('create_title_pk', $migrationName, [

Loading…
Cancel
Save