public static function getSchemaType(ColumnSchema $column)
    {
        // boolean
        if ('tinyint(1)' === $column->dbType) {
            return 'boolean()';
        }

        // enum
        if (null !== $column->enumValues) {
            // https://github.com/yiisoft/yii2/issues/9797
            $enumValues = array_map('addslashes', $column->enumValues);
            return "enum(['".implode('\', \'', $enumValues)."'])";
        }

        switch ($column->type) {
            case 'smallint':
                $type = 'smallInteger';
                break;

            case 'int':
                $type = 'integer';
                break;

            case 'bigint':
                $type = 'bigInteger';
                break;

            default:
                $type = $column->type;
                break;
        }

        // others
        if (null === $column->size) {
            return "$type()";
        } else {
            return "{$type}({$column->size})";
        }

    }
public static function getSchemaType(ColumnSchema $column)
    {
        // boolean
        if ('tinyint(1)' === $column->dbType) {
            return 'boolean()';
        }

        // enum
        if (null !== $column->enumValues) {
            // https://github.com/yiisoft/yii2/issues/9797
            $enumValues = array_map('addslashes', $column->enumValues);
            return "enum(['".implode('\', \'', $enumValues)."'])";
        }

        switch ($column->type) {
            case 'smallint':
                $type = 'smallInteger';
                break;

            case 'int':
                $type = 'integer';
                break;

            case 'bigint':
                $type = 'bigInteger';
                break;

            default:
                $type = $column->type;
                break;
        }

        // others
        if (null === $column->size) {
            return "$type()";
        } else {
            return "{$type}({$column->size})";
        }

    }
public static function getSchemaType ( ColumnSchema $ column ) { // boolean if ( 'tinyint(1)' === $ column -> dbType ) { return 'boolean()' ; } // enum if ( null !== $ column -> enumValues ) { // https://github.com/yiisoft/yii2/issues/9797 $ enumValues = array_map ( 'addslashes' , $ column -> enumValues ) ; return "enum(['" . implode ( '\', \'' , $ enumValues ) . "'])" ; } switch ( $ column -> type ) { case 'smallint' : $ type = 'smallInteger' ; break ; case 'int' : $ type = 'integer' ; break ; case 'bigint' : $ type = 'bigInteger' ; break ; default : $ type = $ column -> type ; break ; } // others if ( null === $ column -> size ) { return "$type()" ; } else { return "{$type}({$column->size})" ; } }
Returns the schema type.
@param ColumnSchema $column
@return string the schema type
Returns the schema type .