protected function _parseColumnType($spec)
    {
        $spec = strtolower($spec);
        $type = null;
        $length = null;
        $scope = null;

        // find the parens, if any
        $pos = strpos($spec, '(');
        if ($pos === false) {
            // no parens, so no size or scope
              $type = $spec;
        } else {
            // find the type first.
              $type = substr($spec, 0, $pos);

              // there were parens, so there's at least a length
               // remove parens to get the size.
              $length = trim(substr($spec, $pos), '()');

            if ($type != 'enum' && $type != 'set') {
                // A comma in the size indicates a scope.
                  $pos = strpos($length, ',');
                if ($pos !== false) {
                    $scope = substr($length, $pos + 1);
                    $length = substr($length, 0, $pos);
                }
            } else {
                $length = explode(',', str_replace("'", '', $length));
            }
        }

        return array($type, $length, $scope);
    }