src/Titon/Db/Sqlite/SqliteDialect.php
public function formatColumns(Schema $schema) {
        $columns = [];

        foreach ($schema->getColumns() as $column => $options) {
            $type = $options['type'];
            $dataType = $this->getDriver()->getType($type);
            $options = $options + $dataType->getDefaultOptions();

            // Sqlite doesn't like the shorthand version
            if ($type === 'int') {
                $type = 'integer';
            }

            if (!empty($options['length'])) {
                $type .= '(' . $options['length'] . ')';
            }

            $output = [$this->quote($column), strtoupper($type)];

            if (!empty($options['primary'])) {
                $output[] = $this->getKeyword(self::NOT_NULL);
                $output[] = $this->getKeyword(self::PRIMARY_KEY);
                $output[] = $this->getKeyword(self::AUTO_INCREMENT);

            } else {
                if (empty($options['null']) || !empty($options['primary'])) {
                    $output[] = $this->getKeyword(self::NOT_NULL);
                }

                if (!empty($options['collate']) && in_array($options['collate'], [self::BINARY, self::NOCASE, self::RTRIM])) {
                    $output[] = sprintf($this->getClause(self::COLLATE), $options['collate']);
                }

                if (array_key_exists('default', $options) && $options['default'] !== '') {
                    $output[] = sprintf($this->getClause(self::DEFAULT_TO), $this->getDriver()->escape($options['default']));
                }
            }

            $columns[] = implode(' ', $output);
        }

        return implode(",\n", $columns);
    }
public function formatColumns(Schema $schema) {
        $columns = [];

        foreach ($schema->getColumns() as $column => $options) {
            $type = $options['type'];
            $dataType = $this->getDriver()->getType($type);
            $options = $options + $dataType->getDefaultOptions();

            // Sqlite doesn't like the shorthand version
            if ($type === 'int') {
                $type = 'integer';
            }

            if (!empty($options['length'])) {
                $type .= '(' . $options['length'] . ')';
            }

            $output = [$this->quote($column), strtoupper($type)];

            if (!empty($options['primary'])) {
                $output[] = $this->getKeyword(self::NOT_NULL);
                $output[] = $this->getKeyword(self::PRIMARY_KEY);
                $output[] = $this->getKeyword(self::AUTO_INCREMENT);

            } else {
                if (empty($options['null']) || !empty($options['primary'])) {
                    $output[] = $this->getKeyword(self::NOT_NULL);
                }

                if (!empty($options['collate']) && in_array($options['collate'], [self::BINARY, self::NOCASE, self::RTRIM])) {
                    $output[] = sprintf($this->getClause(self::COLLATE), $options['collate']);
                }

                if (array_key_exists('default', $options) && $options['default'] !== '') {
                    $output[] = sprintf($this->getClause(self::DEFAULT_TO), $this->getDriver()->escape($options['default']));
                }
            }

            $columns[] = implode(' ', $output);
        }

        return implode(",\n", $columns);
    }
{@inheritdoc}