source/Spiral/ORM/Helpers/ColumnRenderer.php
public function castDefault(AbstractColumn $column)
    {
        if (in_array($column->abstractType(), ['timestamp', 'datetime', 'time', 'date'])) {
            return 0;
        }

        if ($column->abstractType() == 'enum') {
            //We can use first enum value as default
            return $column->getEnumValues()[0];
        }

        switch ($column->phpType()) {
            case 'int':
                return 0;
            case 'float':
                return 0.0;
            case 'bool':
                return false;
        }

        return '';
    }
public function castDefault(AbstractColumn $column)
    {
        if (in_array($column->abstractType(), ['timestamp', 'datetime', 'time', 'date'])) {
            return 0;
        }

        if ($column->abstractType() == 'enum') {
            //We can use first enum value as default
            return $column->getEnumValues()[0];
        }

        switch ($column->phpType()) {
            case 'int':
                return 0;
            case 'float':
                return 0.0;
            case 'bool':
                return false;
        }

        return '';
    }
public function castDefault ( AbstractColumn $ column ) { if ( in_array ( $ column -> abstractType ( ) , [ 'timestamp' , 'datetime' , 'time' , 'date' ] ) ) { return 0 ; } if ( $ column -> abstractType ( ) == 'enum' ) { //We can use first enum value as default return $ column -> getEnumValues ( ) [ 0 ] ; } switch ( $ column -> phpType ( ) ) { case 'int' : return 0 ; case 'float' : return 0.0 ; case 'bool' : return false ; } return '' ; }
Cast default value based on column type. Required to prevent conflicts when not nullable
column added to existed table with data in.

@param AbstractColumn $column

@return mixed
Cast default value based on column type . Required to prevent conflicts when not nullable column added to existed table with data in .