mirror of
				https://github.com/yiisoft/yii2.git
				synced 2025-11-04 14:46:19 +08:00 
			
		
		
		
	Fix #12423 Fix bug migration tool when creating fields with brackets in comment
This commit is contained in:
		@ -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
 | 
			
		||||
-------------------
 | 
			
		||||
 | 
			
		||||
@ -351,7 +351,7 @@ class MigrateController extends BaseMigrateController
 | 
			
		||||
                    continue;
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
                if (!preg_match('/^(.+?)\(([^)]+)\)$/', $chunk)) {
 | 
			
		||||
                if (!preg_match('/^(.+?)\(([^(]+)\)$/', $chunk)) {
 | 
			
		||||
                    $chunk .= '()';
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
@ -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)'),
 | 
			
		||||
        ]);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -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, [
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user