src/Components/Schema.php
protected function getColumnType($info)
    {
        $out = [];
        $type = '';
        if (is_string($info)) {
            $type = trim($info); // cleanup
        } elseif (is_array($info)) {
            $sql = (isset($info['sql'])) ? $info['sql'] : null;
            if (!empty($sql)) {
                return $sql; // raw SQL statement given, pass it on.
            }

            $out = $info;
            $type = (isset($info['type'])) ? $info['type'] : null;
            if (empty($type)) {
                $type = (isset($info['db_type'])) ? $info['db_type'] : null;
                if (empty($type)) {
                    throw new \Exception("Invalid schema detected - no type or db_type element.");
                }
            }
            $type = trim($type); // cleanup
        }

        if (empty($type)) {
            throw new \Exception("Invalid schema detected - no type definition.");
        }

        //  If there are extras, then pass it on through
        if ((false !== strpos($type, ' ')) || (false !== strpos($type, '('))) {
            return $type;
        }

        $out['type'] = $type;
        $this->translateSimpleColumnTypes($out);
        $this->validateColumnSettings($out);

        return $this->buildColumnDefinition($out);
    }
protected function getColumnType($info)
    {
        $out = [];
        $type = '';
        if (is_string($info)) {
            $type = trim($info); // cleanup
        } elseif (is_array($info)) {
            $sql = (isset($info['sql'])) ? $info['sql'] : null;
            if (!empty($sql)) {
                return $sql; // raw SQL statement given, pass it on.
            }

            $out = $info;
            $type = (isset($info['type'])) ? $info['type'] : null;
            if (empty($type)) {
                $type = (isset($info['db_type'])) ? $info['db_type'] : null;
                if (empty($type)) {
                    throw new \Exception("Invalid schema detected - no type or db_type element.");
                }
            }
            $type = trim($type); // cleanup
        }

        if (empty($type)) {
            throw new \Exception("Invalid schema detected - no type definition.");
        }

        //  If there are extras, then pass it on through
        if ((false !== strpos($type, ' ')) || (false !== strpos($type, '('))) {
            return $type;
        }

        $out['type'] = $type;
        $this->translateSimpleColumnTypes($out);
        $this->validateColumnSettings($out);

        return $this->buildColumnDefinition($out);
    }
Converts an abstract column type into a physical column type.
The conversion is done using the type map specified in {@link columnTypes}.
These abstract column types are supported (using MySQL as example to explain the corresponding
physical types):
<ul>
<li>pk: an auto-incremental primary key type, will be converted into "int(11) NOT NULL AUTO_INCREMENT PRIMARY
KEY"</li>
<li>string: string type, will be converted into "varchar(255)"</li>
<li>text: a long string type, will be converted into "text"</li>
<li>integer: integer type, will be converted into "int(11)"</li>
<li>boolean: boolean type, will be converted into "tinyint(1)"</li>
<li>float: float number type, will be converted into "float"</li>
<li>decimal: decimal number type, will be converted into "decimal"</li>
<li>datetime: datetime type, will be converted into "datetime"</li>
<li>timestamp: timestamp type, will be converted into "timestamp"</li>
<li>time: time type, will be converted into "time"</li>
<li>date: date type, will be converted into "date"</li>
<li>binary: binary data type, will be converted into "blob"</li>
</ul>

If the abstract type contains two or more parts separated by spaces or '(' (e.g. "string NOT NULL" or
"decimal(10,2)"), then only the first part will be converted, and the rest of the parts will be appended to the
conversion result. For example, 'string NOT NULL' is converted to 'varchar(255) NOT NULL'.

@param string $info abstract column type

@return string physical column type including arguments, null designation and defaults.
@throws \Exception