{"id":"9048ec3e1a2315d5","repo":"laravel/framework","slug":"this-database-driver-does-not-support-fulltext-ind","errorCode":null,"errorMessage":"This database driver does not support fulltext index creation.","messagePattern":"This database driver does not support fulltext index creation\\.","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"src/Illuminate/Database/Schema/Grammars/Grammar.php","lineNumber":226,"sourceCode":"     * @throws \\RuntimeException\n     */\n    public function compileChange(Blueprint $blueprint, Fluent $command)\n    {\n        throw new RuntimeException('This database driver does not support modifying columns.');\n    }\n\n    /**\n     * Compile a fulltext index key 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 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.","sourceCodeStart":208,"sourceCodeEnd":244,"githubUrl":"https://github.com/laravel/framework/blob/bd6b5437e6ad87bb49f9b426724f07a9f64e9683/src/Illuminate/Database/Schema/Grammars/Grammar.php#L208-L244","documentation":"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.","triggerScenarios":"Calling $table->fullText(['summary','body']) in a migration against SQLite or SQL Server, or any driver whose grammar does not override compileFulltext.","commonSituations":"Running a migration written for MySQL on SQLite tests; CI defaulting to SQLite while app migrations use fullText().","solutions":["Use MySQL (or Postgres with its fullText support) if you need full-text indexes.","Remove the fullText() call from migrations running on unsupported drivers.","Conditionally apply fullText() only when the driver supports it."],"exampleFix":"// before\nSchema::create('posts', function (Blueprint $t) {\n    $t->string('title');\n    $t->text('body');\n    $t->fullText(['title','body']);\n});\n\n// after\n$driver = DB::connection()->getDriverName();\nSchema::create('posts', function (Blueprint $t) use ($driver) {\n    $t->string('title');\n    $t->text('body');\n    if (in_array($driver, ['mysql','pgsql'], true)) {\n        $t->fullText(['title','body']);\n    }\n});","handlingStrategy":"validation","validationCode":"$driver = DB::connection()->getDriverName();\nif (! in_array($driver, ['mysql','pgsql'], true)) {\n    return; // fullText not supported\n}\nSchema::create('posts', fn (Blueprint $t) => $t->fullText(['title','body']));","typeGuard":"function driverSupportsFullTextCreate(): bool\n{\n    return in_array(DB::connection()->getDriverName(), ['mysql','pgsql'], true);\n}","tryCatchPattern":"try {\n    Schema::table('posts', fn (Blueprint $t) => $t->fullText(['title','body']));\n} catch (\\RuntimeException $e) {\n    if (str_contains($e->getMessage(), 'fulltext index creation')) {\n        // skip on unsupported drivers\n    } else {\n        throw $e;\n    }\n}","preventionTips":["Guard fullText() by driver.","Align CI driver with production driver.","Use MySQL/Postgres for full-text search features."],"tags":["schema","database","driver-support","grammar","fulltext","indexes","migrations"],"analyzedSha":"bd6b5437e6ad87bb49f9b426724f07a9f64e9683","analyzedAt":"2026-08-06T00:28:32.783Z","schemaVersion":2}