|
|
@ -43,9 +43,6 @@ class Schema extends \yii\db\Schema |
|
|
|
'time' => self::TYPE_TIME, |
|
|
|
'time' => self::TYPE_TIME, |
|
|
|
'timestamp' => self::TYPE_TIMESTAMP, |
|
|
|
'timestamp' => self::TYPE_TIMESTAMP, |
|
|
|
'datetime' => self::TYPE_DATETIME, |
|
|
|
'datetime' => self::TYPE_DATETIME, |
|
|
|
// Bit string data types |
|
|
|
|
|
|
|
// 'bit' => self::TYPE_BINARY, // TODO |
|
|
|
|
|
|
|
// 'bit varying' => self::TYPE_BINARY, |
|
|
|
|
|
|
|
// String data types |
|
|
|
// String data types |
|
|
|
'char' => self::TYPE_STRING, |
|
|
|
'char' => self::TYPE_STRING, |
|
|
|
'varchar' => self::TYPE_STRING, |
|
|
|
'varchar' => self::TYPE_STRING, |
|
|
@ -56,6 +53,9 @@ class Schema extends \yii\db\Schema |
|
|
|
// BLOB/CLOB data types |
|
|
|
// BLOB/CLOB data types |
|
|
|
'blob' => self::TYPE_BINARY, |
|
|
|
'blob' => self::TYPE_BINARY, |
|
|
|
'clob' => self::TYPE_BINARY, |
|
|
|
'clob' => self::TYPE_BINARY, |
|
|
|
|
|
|
|
// Bit string data types |
|
|
|
|
|
|
|
// 'bit' => self::TYPE_STRING, |
|
|
|
|
|
|
|
// 'bit varying' => self::TYPE_STRING, |
|
|
|
// Collection data types (TODO are considered strings for now, naybe support conversion?) |
|
|
|
// Collection data types (TODO are considered strings for now, naybe support conversion?) |
|
|
|
// 'set' => self::TYPE_STRING, |
|
|
|
// 'set' => self::TYPE_STRING, |
|
|
|
// 'multiset' => self::TYPE_STRING, |
|
|
|
// 'multiset' => self::TYPE_STRING, |
|
|
@ -106,7 +106,7 @@ class Schema extends \yii\db\Schema |
|
|
|
$tableInfo = $this->db->pdo->cubrid_schema(\PDO::CUBRID_SCH_TABLE, $name); |
|
|
|
$tableInfo = $this->db->pdo->cubrid_schema(\PDO::CUBRID_SCH_TABLE, $name); |
|
|
|
|
|
|
|
|
|
|
|
if (isset($tableInfo[0]['NAME'])) { |
|
|
|
if (isset($tableInfo[0]['NAME'])) { |
|
|
|
$table = new TableSchema; |
|
|
|
$table = new TableSchema(); |
|
|
|
$table->name = $tableInfo[0]['NAME']; |
|
|
|
$table->name = $tableInfo[0]['NAME']; |
|
|
|
|
|
|
|
|
|
|
|
$sql = 'SHOW FULL COLUMNS FROM ' . $this->quoteSimpleTableName($table->name); |
|
|
|
$sql = 'SHOW FULL COLUMNS FROM ' . $this->quoteSimpleTableName($table->name); |
|
|
@ -145,7 +145,7 @@ class Schema extends \yii\db\Schema |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
protected function loadColumnSchema($info) |
|
|
|
protected function loadColumnSchema($info) |
|
|
|
{ |
|
|
|
{ |
|
|
|
$column = new ColumnSchema; |
|
|
|
$column = new ColumnSchema(); |
|
|
|
|
|
|
|
|
|
|
|
$column->name = $info['Field']; |
|
|
|
$column->name = $info['Field']; |
|
|
|
$column->allowNull = $info['Null'] === 'YES'; |
|
|
|
$column->allowNull = $info['Null'] === 'YES'; |
|
|
@ -174,13 +174,13 @@ class Schema extends \yii\db\Schema |
|
|
|
if (isset($values[1])) { |
|
|
|
if (isset($values[1])) { |
|
|
|
$column->scale = (int)$values[1]; |
|
|
|
$column->scale = (int)$values[1]; |
|
|
|
} |
|
|
|
} |
|
|
|
if ($column->size === 1 && ($type === 'tinyint' || $type === 'bit')) { |
|
|
|
if ($type === 'bit' || $type === 'bit varying') { |
|
|
|
$column->type = 'boolean'; |
|
|
|
if ($column->size === 1) { |
|
|
|
} elseif ($type === 'bit' || $type === 'bit varying') { |
|
|
|
$column->type = self::TYPE_BOOLEAN; |
|
|
|
if ($column->size > 32) { |
|
|
|
} elseif ($column->size > 32) { |
|
|
|
$column->type = 'bigint'; |
|
|
|
$column->type = self::TYPE_BIGINT; |
|
|
|
} elseif ($column->size === 32) { |
|
|
|
} elseif ($column->size === 32) { |
|
|
|
$column->type = 'integer'; |
|
|
|
$column->type = self::TYPE_INTEGER; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|