src/Database/Schemas/MysqlSchema.php
public static function add($name, $script)
    {
        if (self::existe($name)) {
            $name = self::table($name);
            //
            self::$query = 'alter table '.$name.' ';
            //
            $object = new self();
            $script($object);
            //
            $query = '';
            for ($i = 0; $i < Collection::count(self::$colmuns); $i++) {
                $query .= ' add '.self::$colmuns[$i].(($i == (Collection::count(self::$colmuns) - 1)) ? '' : ',');
            }
            //
            self::$query .= $query;
            //
            return Database::exec(self::$query);
        } else {
            throw new SchemaTableNotExistException($name);
        }
    }
public static function add($name, $script)
    {
        if (self::existe($name)) {
            $name = self::table($name);
            //
            self::$query = 'alter table '.$name.' ';
            //
            $object = new self();
            $script($object);
            //
            $query = '';
            for ($i = 0; $i < Collection::count(self::$colmuns); $i++) {
                $query .= ' add '.self::$colmuns[$i].(($i == (Collection::count(self::$colmuns) - 1)) ? '' : ',');
            }
            //
            self::$query .= $query;
            //
            return Database::exec(self::$query);
        } else {
            throw new SchemaTableNotExistException($name);
        }
    }
public static function add ( $ name , $ script ) { if ( self :: existe ( $ name ) ) { $ name = self :: table ( $ name ) ; // self :: $ query = 'alter table ' . $ name . ' ' ; // $ object = new self ( ) ; $ script ( $ object ) ; // $ query = '' ; for ( $ i = 0 ; $ i < Collection :: count ( self :: $ colmuns ) ; $ i ++ ) { $ query .= ' add ' . self :: $ colmuns [ $ i ] . ( ( $ i == ( Collection :: count ( self :: $ colmuns ) - 1 ) ) ? '' : ',' ) ; } // self :: $ query .= $ query ; // return Database :: exec ( self :: $ query ) ; } else { throw new SchemaTableNotExistException ( $ name ) ; } }
function to build query for adding column to table.

@param string   $name
@param callable $script

@return bool
function to build query for adding column to table .