Commit c24ae25b by Alexander Makarov

Fixed getting default values from schema for SQLite

parent 1ff9dedf
...@@ -238,9 +238,9 @@ class Schema extends \yii\db\Schema ...@@ -238,9 +238,9 @@ class Schema extends \yii\db\Schema
} }
$column->phpType = $this->getColumnPhpType($column); $column->phpType = $this->getColumnPhpType($column);
$value = $info['dflt_value']; $value = trim($info['dflt_value'], "'\"");
if ($column->type === 'string') { if ($column->type === 'string') {
$column->defaultValue = trim($value, "'\""); $column->defaultValue = $value;
} else { } else {
$column->defaultValue = $column->typecast(strcasecmp($value, 'null') ? $value : null); $column->defaultValue = $column->typecast(strcasecmp($value, 'null') ? $value : null);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment