protected function compileColumnDefinition(array $options)
    {
        $options = array_merge([
            'type'      => null,
            'size'      => null,
            'scale'     => null,
            'nullable'  => false,
            'default'   => null,
            'collation' => null,
            'comment'   => null,
        ], $options);

        $type   = strtolower($options['type']);

        if ($type == 'identity') { // Is the column the auto-incremented primary key?
            $sql = 'INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT';
        }
        else if ($type == 'bigidentity') {
            $sql = 'BIGINT NOT NULL PRIMARY KEY AUTO_INCREMENT';
        }
        else {
            $size   = $options['size'];
            $scale  = $options['scale'];
            $sql = $this->compileFieldType($type, $size, $scale);

            if (!$options['nullable']) {
                $sql .= ' NOT NULL';
            }

            if ($options['default'] !== null) {
                $default = $options['default'];
                if (is_string($default) && $default != 'CURRENT_TIMESTAMP') {
                    $default = $this->db->quote($options['default']);
                } else if (is_bool($default)) {
                    $default = $default ? '1' : '0';
                }
                $sql .= ' DEFAULT ' . $default;
            }

            if (!empty($options['collation'])) {
                $sql .= ' COLLATE ' . $options['collation'];
            }
        }

        $comment = $options['comment'];
        if ($this->needATypeHint($type)) {
            $comment = ($comment !== null ? $comment . ' ' : '') . '(DC2Type:' . $type . ')';
        }

        if (!is_null($comment)) {
            $sql .= ' COMMENT ' . $this->db->quote($comment);
        }

        return $sql;
    }