laravel/framework · error · RuntimeException

This database driver does not support fulltext index removal

Error message

This database driver does not support fulltext index removal.

What it means

Base Grammar::compileDropFullText() throws RuntimeException when the driver's grammar does not support dropping FULLTEXT indexes. It mirrors compileFulltext: drivers that can create fulltext can usually drop it; others cannot. Thrown when $table->dropFullText() is compiled on an unsupported grammar.

Source

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

     * @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.
     *
     * @param  \Illuminate\Database\Schema\Blueprint  $blueprint
     * @param  \Illuminate\Support\Fluent  $command
     * @return string
     */
    public function compileForeign(Blueprint $blueprint, Fluent $command)
    {
        // We need to prepare several of the elements of the foreign key definition
        // before we can create the SQL, such as wrapping the tables and convert
        // an array of columns to comma-delimited strings for the SQL queries.
        $sql = sprintf('alter table %s add constraint %s ',
            $this->wrapTable($blueprint),
            $this->wrap($command->index)
        );

View on GitHub (pinned to bd6b5437e6)

Solutions

  1. Use a driver whose grammar overrides compileDropFullText (mysql).
  2. Remove the dropFullText() call on unsupported drivers.
  3. Manually drop the index via DB::statement('DROP INDEX ...') if the engine supports it.

Example fix

// before
Schema::table('posts', fn (Blueprint $t) => $t->dropFullText('posts_title_body_fulltext'));

// after
if (DB::connection()->getDriverName() === 'mysql') {
    Schema::table('posts', fn (Blueprint $t) => $t->dropFullText('posts_title_body_fulltext'));
}
Defensive patterns

Strategy: validation

Validate before calling

$driver = DB::connection()->getDriverName();
if (! in_array($driver, ['mysql','pgsql'], true)) {
    return;
}
Schema::table('posts', fn (Blueprint $t) => $t->dropFullText('posts_title_body_fulltext'));

Type guard

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

Try / catch

try {
    Schema::table('posts', fn (Blueprint $t) => $t->dropFullText('posts_title_body_fulltext'));
} catch (\RuntimeException $e) {
    if (str_contains($e->getMessage(), 'fulltext index removal')) {
        // skip on unsupported drivers
    } else {
        throw $e;
    }
}

Prevention

When it happens

Trigger: Calling $table->dropFullText('index_name') in a migration against SQLite/SQL Server or a custom grammar without the override.

Common situations: Rollback migration written for MySQL run against SQLite tests; CI driver mismatch.

Related errors


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