Skip to content

Commit

Permalink
Updated extractType for correct types;
Browse files Browse the repository at this point in the history
  • Loading branch information
edgardmessias committed Feb 19, 2013
1 parent 6f1e28b commit dc9035c
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions CFirebirdColumnSchema.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,13 @@ class CFirebirdColumnSchema extends CDbColumnSchema
protected function extractType($dbType)
{
// @todo Need to handle more data types here.
if (stripos($dbType, 'int') !== false && stripos($dbType, 'unsigned int') === false) {
//Types timestamp, date, time, text, blob are string in PHP
if (stripos($dbType, 'int') !== false || stripos($dbType, 'quad') !== false) {
$this->type = 'integer';
} elseif (stripos($dbType, 'bool') !== false) {
$this->type = 'boolean';
} elseif (preg_match('/(numeric|decimal|floa|doub)/i', $dbType)) {
$this->type = 'double';
} elseif (stripos($dbType, 'timestamp') !== false) {
$this->type = 'timestamp';
} elseif (stripos($dbType, 'date') !== false) {
$this->type = 'date';
} elseif (stripos($dbType, 'time') !== false) {
$this->type = 'time';
} elseif (stripos($dbType, 'text') !== false) {
$this->type = 'text';
} elseif (stripos($dbType, 'blob') !== false) {
$this->type = 'binary';
} else {
$this->type = 'string';
}
Expand All @@ -52,8 +43,6 @@ protected function extractType($dbType)
*/
protected function extractDefault($defaultValue)
{
$defaultValue = strtoupper($defaultValue);

/*
* handle CURRENT_DATE/TIME/TIMESTAMP with optional precision
* @todo handle context variable 'NOW'
Expand Down

0 comments on commit dc9035c

Please sign in to comment.