src/Db/MySqlDb.php
protected function getColumnOrders($cdefs) {
        $orders = array_flip(array_keys($cdefs));

        $prev = ' first';
        foreach ($orders as $cname => &$value) {
            $value = $prev;
            $prev = ' after '.$this->backtick($cname);
        }
        return $orders;
    }
protected function getColumnOrders($cdefs) {
        $orders = array_flip(array_keys($cdefs));

        $prev = ' first';
        foreach ($orders as $cname => &$value) {
            $value = $prev;
            $prev = ' after '.$this->backtick($cname);
        }
        return $orders;
    }
Get an array of column orders so that added columns can be slotted into their correct spot.

@param array $cdefs An array of column definitions.
@return array Returns an array of column orders suitable for an `alter table` statement.