Fix #18303: Fix creating migration issue for column methods used after defaultValues

This commit is contained in:
Walid Said
2020-10-05 00:02:21 +02:00
committed by GitHub
parent 7a50da5cf8
commit 3f3003d823
4 changed files with 55 additions and 1 deletions

View File

@ -7,6 +7,7 @@ Yii Framework 2 Change Log
- Bug #18290: Fix response with non-seekable streams (schmunk42)
- Bug #16418: Fixed `yii\data\Pagination::getLinks()` to return links to the first and the last pages regardless of the current page (ptz-nerf, bizley)
- Bug #18297: Replace usage of deprecated `ReflectionParameter::isArray()` method in PHP8 (baletskyi)
- Bug #18303: Fix creating migration issue for column methods used after defaultValues (wsaid)
- Bug #18287: Fix for OUTPUT INSERTED and computed columns. Added flag to computed values in table schema (darkdef)
- Bug #18308: Fixed `\yii\base\Model::getErrorSummary()` reverse order (DrDeath72)

View File

@ -581,7 +581,7 @@ class MigrateController extends BaseMigrateController
protected function splitFieldIntoChunks($field)
{
$hasDoubleQuotes = false;
preg_match_all('/defaultValue\(.*?:.*?\)/', $field, $matches);
preg_match_all('/defaultValue\(["\'].*?:?.*?["\']\)/', $field, $matches, PREG_SET_ORDER, 0);
if (isset($matches[0][0])) {
$hasDoubleQuotes = true;
$originalDefaultValue = $matches[0][0];