Commit 2202ae6c by wenbin1989 Committed by Qiang Xue

Fixes #6080: Oracle DB schema did not load column types correctly

parent bbbeae95
......@@ -4,6 +4,7 @@ Yii Framework 2 Change Log
2.0.2 under development
-----------------------
- Bug #6080: Oracle DB schema did not load column types correctly (wenbin1989)
- Bug #6404: advanced application template `Alert` widget was generating duplicate IDs in case of multiple flashes (SDKiller)
- Enh #6247: Logger and error handler are now using slightly less memory (stepanselyuk, samdark)
- Enh #6434: Added `yii\behaviors\SluggableBehavior::immutable` to support keeping the generated slug unchanged (trntv)
......
......@@ -213,6 +213,8 @@ EOD;
$this->extractColumnType($c, $column['DATA_TYPE']);
$this->extractColumnSize($c, $column['DATA_TYPE']);
$c->phpType = $this->getColumnPhpType($c);
if (!$c->isPrimaryKey) {
if (stripos($column['DATA_DEFAULT'], 'timestamp') !== false) {
$c->defaultValue = null;
......@@ -302,6 +304,10 @@ EOD;
} else {
$column->type = 'double';
}
} elseif (strpos($dbType, 'BLOB') !== false) {
$column->type = 'binary';
} elseif (strpos($dbType, 'CLOB') !== false) {
$column->type = 'text';
} else {
$column->type = 'string';
}
......
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