Browse Source

Fixed getting default values from schema for SQLite

tags/2.0.0-beta
Alexander Makarov 11 years ago
parent
commit
c24ae25be2
  1. 4
      framework/db/sqlite/Schema.php

4
framework/db/sqlite/Schema.php

@ -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);
} }

Loading…
Cancel
Save