diff --git a/dibi/drivers/mysql.php b/dibi/drivers/mysql.php index 6400d10c..a8349baa 100644 --- a/dibi/drivers/mysql.php +++ b/dibi/drivers/mysql.php @@ -476,6 +476,7 @@ class DibiMySqlDriver extends DibiObject implements IDibiDriver 'table' => $table, 'nativetype' => strtoupper($type[0]), 'size' => isset($type[1]) ? (int) $type[1] : NULL, + 'unsigned' => (bool) strstr('unsigned', $row['Type']), 'nullable' => $row['Null'] === 'YES', 'default' => $row['Default'], 'autoincrement' => $row['Extra'] === 'auto_increment', diff --git a/dibi/drivers/mysqli.php b/dibi/drivers/mysqli.php index d90dfee4..976da567 100644 --- a/dibi/drivers/mysqli.php +++ b/dibi/drivers/mysqli.php @@ -479,6 +479,7 @@ class DibiMySqliDriver extends DibiObject implements IDibiDriver 'table' => $table, 'nativetype' => strtoupper($type[0]), 'size' => isset($type[1]) ? (int) $type[1] : NULL, + 'unsigned' => (bool) strstr('unsigned', $row['Type']), 'nullable' => $row['Null'] === 'YES', 'default' => $row['Default'], 'autoincrement' => $row['Extra'] === 'auto_increment', diff --git a/dibi/libs/DibiDatabaseInfo.php b/dibi/libs/DibiDatabaseInfo.php index bf67071f..8e29054d 100644 --- a/dibi/libs/DibiDatabaseInfo.php +++ b/dibi/libs/DibiDatabaseInfo.php @@ -532,6 +532,16 @@ class DibiColumnInfo extends DibiObject /** * @return bool */ + public function isUnsigned() + { + return isset($this->info['unsigned']) ? (bool) $this->info['unsigned'] : NULL; + } + + + + /** + * @return bool + */ public function isNullable() { return isset($this->info['nullable']) ? (bool) $this->info['nullable'] : NULL;