{"record":{"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/e0f6eb3518ac29fbbca8529e97d0df7fc9f24481/src/Illuminate/Database/Schema/Grammars/Grammar.php#L222-L258","documentation":"Grammar::compileDropFullText() throws RuntimeException on the base. PostgresGrammar and MySqlGrammar override it; SQLiteGrammar and SqlServerGrammar inherit the stub. It compiles a dropFullText()/dropIndex() command targeting a fulltext index.","triggerScenarios":"Calling $table->dropFullText(...) or dropping an index named as fulltext on SQLite or SQL Server - engines whose grammars in this codebase do not override compileDropFullText.","commonSituations":"Rolling back a migration that created a fulltext index while testing on SQLite; a cross-engine migration set that drops fulltext indexes without gating by driver.","solutions":["Run dropFullText on Postgres or MySQL only.","In tests on SQLite, skip the dropFullText call or avoid creating fulltext indexes there in the first place.","Drop the index with raw DDL appropriate to the engine as a fallback."],"exampleFix":"// before - throws on SQLite/SQL Server\nSchema::table('posts', function (Blueprint $t) {\n    $t->dropFullText(['title', 'body']);\n});\n\n// after - gate by driver\nSchema::table('posts', function (Blueprint $t) {\n    if (in_array(config('database.default'), ['pgsql', 'mysql'])) {\n        $t->dropFullText(['title', 'body']);\n    }\n});","handlingStrategy":"validation","validationCode":"$driver = Schema::getConnection()->getDriverName(); // 'pgsql','mysql','sqlite','sqlsrv'\nif (! in_array($driver, ['pgsql', 'mysql'], true)) {\n    throw new \\DomainException(\"dropFullText is unsupported on driver '{$driver}'.\");\n}","typeGuard":"function supportsDropFullText(string $driverName): bool\n{\n    return in_array($driverName, ['pgsql', 'mysql'], true);\n}","tryCatchPattern":"try {\n    Schema::table('posts', fn ($t) => $t->dropFullText(['title', 'body']));\n} catch (\\RuntimeException $e) {\n    if (str_contains($e->getMessage(), 'fulltext index removal')) {\n        DB::statement('ALTER TABLE posts DROP INDEX ft_title_body');\n    } else {\n        throw $e;\n    }\n}","preventionTips":["Run dropFullText only on Postgres or MySQL.","Avoid creating fulltext indexes on SQLite test DBs so rollback does not need dropFullText.","Gate dropFullText by driver in cross-engine migrations."],"tags":["schema","grammar","database-driver","fulltext","runtime-exception"],"backgroundTag":null,"analyzedSha":"e0f6eb3518ac29fbbca8529e97d0df7fc9f24481","analyzedAt":"2026-08-11T20:52:37.562Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}