laravel/framework · error · RuntimeException

This database driver does not support fulltext index creatio

Error message

This database driver does not support fulltext index creation.

What it means

Base Grammar::compileFulltext() throws RuntimeException because the driver does not support creating FULLTEXT indexes. MySQL overrides it (FULLTEXT INDEX); Postgres provides it via tsvector/GIN; SQLite and SQL Server do not support fulltext creation through this method. Thrown when $table->fullText() is compiled on an unsupported grammar.

Source

Thrown at src/Illuminate/Database/Schema/Grammars/Grammar.php:226

     * @throws \RuntimeException
     */
    public function compileChange(Blueprint $blueprint, Fluent $command)
    {
        throw new RuntimeException('This database driver does not support modifying columns.');
    }

    /**
     * Compile a fulltext index key command.
     *
     * @param  \Illuminate\Database\Schema\Blueprint  $blueprint
     * @param  \Illuminate\Support\Fluent  $command
     * @return string
     *
     * @throws \RuntimeException
     */
    public function compileFulltext(Blueprint $blueprint, Fluent $command)
    {
        throw new RuntimeException('This database driver does not support fulltext index creation.');
    }

    /**
     * Compile a drop fulltext index command.
     *
     * @param  \Illuminate\Database\Schema\Blueprint  $blueprint
     * @param  \Illuminate\Support\Fluent  $command
     * @return string
     *
     * @throws \RuntimeException
     */
    public function compileDropFullText(Blueprint $blueprint, Fluent $command)
    {
        throw new RuntimeException('This database driver does not support fulltext index removal.');
    }

    /**
     * Compile a foreign key command.

View on GitHub (pinned to bd6b5437e6)

Solutions

  1. Use MySQL (or Postgres with its fullText support) if you need full-text indexes.
  2. Remove the fullText() call from migrations running on unsupported drivers.
  3. Conditionally apply fullText() only when the driver supports it.

Example fix

// before
Schema::create('posts', function (Blueprint $t) {
    $t->string('title');
    $t->text('body');
    $t->fullText(['title','body']);
});

// after
$driver = DB::connection()->getDriverName();
Schema::create('posts', function (Blueprint $t) use ($driver) {
    $t->string('title');
    $t->text('body');
    if (in_array($driver, ['mysql','pgsql'], true)) {
        $t->fullText(['title','body']);
    }
});
Defensive patterns

Strategy: validation

Validate before calling

$driver = DB::connection()->getDriverName();
if (! in_array($driver, ['mysql','pgsql'], true)) {
    return; // fullText not supported
}
Schema::create('posts', fn (Blueprint $t) => $t->fullText(['title','body']));

Type guard

function driverSupportsFullTextCreate(): bool
{
    return in_array(DB::connection()->getDriverName(), ['mysql','pgsql'], true);
}

Try / catch

try {
    Schema::table('posts', fn (Blueprint $t) => $t->fullText(['title','body']));
} catch (\RuntimeException $e) {
    if (str_contains($e->getMessage(), 'fulltext index creation')) {
        // skip on unsupported drivers
    } else {
        throw $e;
    }
}

Prevention

When it happens

Trigger: Calling $table->fullText(['summary','body']) in a migration against SQLite or SQL Server, or any driver whose grammar does not override compileFulltext.

Common situations: Running a migration written for MySQL on SQLite tests; CI defaulting to SQLite while app migrations use fullText().

Related errors


AI-assisted analysis of laravel/framework@bd6b5437e6 (2026-08-06). Data as JSON: /data/errors/9048ec3e1a2315d5.json. Report an issue: GitHub.