{"id":"dab1fb6c6d981af5","repo":"laravel/framework","slug":"this-database-driver-does-not-support-fulltext-ind-dab1fb","errorCode":null,"errorMessage":"This database driver does not support fulltext index removal.","messagePattern":"This database driver does not support fulltext index removal\\.","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"src/Illuminate/Database/Schema/Grammars/Grammar.php","lineNumber":240,"sourceCode":"     * @throws \\RuntimeException\n     */\n    public function compileFulltext(Blueprint $blueprint, Fluent $command)\n    {\n        throw new RuntimeException('This database driver does not support fulltext index creation.');\n    }\n\n    /**\n     * Compile a drop fulltext index command.\n     *\n     * @param  \\Illuminate\\Database\\Schema\\Blueprint  $blueprint\n     * @param  \\Illuminate\\Support\\Fluent  $command\n     * @return string\n     *\n     * @throws \\RuntimeException\n     */\n    public function compileDropFullText(Blueprint $blueprint, Fluent $command)\n    {\n        throw new RuntimeException('This database driver does not support fulltext index removal.');\n    }\n\n    /**\n     * Compile a foreign key command.\n     *\n     * @param  \\Illuminate\\Database\\Schema\\Blueprint  $blueprint\n     * @param  \\Illuminate\\Support\\Fluent  $command\n     * @return string\n     */\n    public function compileForeign(Blueprint $blueprint, Fluent $command)\n    {\n        // We need to prepare several of the elements of the foreign key definition\n        // before we can create the SQL, such as wrapping the tables and convert\n        // an array of columns to comma-delimited strings for the SQL queries.\n        $sql = sprintf('alter table %s add constraint %s ',\n            $this->wrapTable($blueprint),\n            $this->wrap($command->index)\n        );","sourceCodeStart":222,"sourceCodeEnd":258,"githubUrl":"https://github.com/laravel/framework/blob/bd6b5437e6ad87bb49f9b426724f07a9f64e9683/src/Illuminate/Database/Schema/Grammars/Grammar.php#L222-L258","documentation":"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.","triggerScenarios":"Calling $table->dropFullText('index_name') in a migration against SQLite/SQL Server or a custom grammar without the override.","commonSituations":"Rollback migration written for MySQL run against SQLite tests; CI driver mismatch.","solutions":["Use a driver whose grammar overrides compileDropFullText (mysql).","Remove the dropFullText() call on unsupported drivers.","Manually drop the index via DB::statement('DROP INDEX ...') if the engine supports it."],"exampleFix":"// before\nSchema::table('posts', fn (Blueprint $t) => $t->dropFullText('posts_title_body_fulltext'));\n\n// after\nif (DB::connection()->getDriverName() === 'mysql') {\n    Schema::table('posts', fn (Blueprint $t) => $t->dropFullText('posts_title_body_fulltext'));\n}","handlingStrategy":"validation","validationCode":"$driver = DB::connection()->getDriverName();\nif (! in_array($driver, ['mysql','pgsql'], true)) {\n    return;\n}\nSchema::table('posts', fn (Blueprint $t) => $t->dropFullText('posts_title_body_fulltext'));","typeGuard":"function driverSupportsFullTextDrop(): bool\n{\n    return in_array(DB::connection()->getDriverName(), ['mysql','pgsql'], true);\n}","tryCatchPattern":"try {\n    Schema::table('posts', fn (Blueprint $t) => $t->dropFullText('posts_title_body_fulltext'));\n} catch (\\RuntimeException $e) {\n    if (str_contains($e->getMessage(), 'fulltext index removal')) {\n        // skip on unsupported drivers\n    } else {\n        throw $e;\n    }\n}","preventionTips":["Guard dropFullText() by driver.","Keep rollback migrations consistent with the create migration's driver support.","Use DB::statement('ALTER TABLE ... DROP INDEX ...') for manual cleanup on unsupported drivers."],"tags":["schema","database","driver-support","grammar","fulltext","indexes","migrations"],"analyzedSha":"bd6b5437e6ad87bb49f9b426724f07a9f64e9683","analyzedAt":"2026-08-06T00:28:32.783Z","schemaVersion":2}