{"record":{"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/e0f6eb3518ac29fbbca8529e97d0df7fc9f24481/src/Illuminate/Database/Schema/Grammars/Grammar.php#L208-L244","documentation":"Grammar::compileFulltext() throws RuntimeException on the base; ONLY PostgresGrammar overrides it. Notably the shipped MySQL/SQLite/SQL Server grammars inherit the throwing stub for compileFulltext. It compiles a fullText() index command emitted from a Blueprint.","triggerScenarios":"Defining $table->fullText(['title', 'body']) in a migration running against MySQL, SQLite, or SQL Server - i.e. any non-Postgres supported driver. The Blueprint emits a fulltext command, the grammar cannot compile it, and the migration fails.","commonSituations":"Migrating a Postgres full-text-search schema onto MySQL (where fulltext historically uses a different code path) or SQLite for testing; assuming fullText() works the same on every engine.","solutions":["Run fullText() migrations on Postgres, where compileFulltext is implemented.","On MySQL, use the engine's native FULLTEXT KEY via raw SQL (DB::statement) instead of the Blueprint fullText() command, since this codebase's MySqlGrammar does not override compileFulltext.","In tests on SQLite, skip the fullText() call conditionally."],"exampleFix":"// before - throws on MySQL/SQLite/SQL Server\nSchema::create('posts', function (Blueprint $t) {\n    $t->id();\n    $t->string('title');\n    $t->text('body');\n    $t->fullText(['title', 'body']);\n});\n\n// after - only on Postgres\nSchema::create('posts', function (Blueprint $t) {\n    $t->id();\n    $t->string('title');\n    $t->text('body');\n    if (config('database.default') === 'pgsql') {\n        $t->fullText(['title', 'body']);\n    }\n});","handlingStrategy":"validation","validationCode":"use Illuminate\\Database\\PostgresConnection;\n\nif (Schema::getConnection() instanceof PostgresConnection) {\n    // safe to call fullText()\n} else {\n    throw new \\DomainException('Blueprint fullText() is implemented only for Postgres in this codebase.');\n}","typeGuard":"use Illuminate\\Database\\PostgresConnection;\n\nfunction supportsBlueprintFullText(\\Illuminate\\Database\\Connection $connection): bool\n{\n    return $connection instanceof PostgresConnection;\n}","tryCatchPattern":"try {\n    Schema::table('posts', fn ($t) => $t->fullText(['title', 'body']));\n} catch (\\RuntimeException $e) {\n    if (str_contains($e->getMessage(), 'fulltext index creation')) {\n        DB::statement('ALTER TABLE posts ADD FULLTEXT INDEX ft_title_body (title, body)'); // MySQL native\n    } else {\n        throw $e;\n    }\n}","preventionTips":["Run fullText() migrations on Postgres only; on MySQL use engine-native FULLTEXT via raw SQL.","Skip fullText() in SQLite test migrations.","Keep a per-engine migration map for full-text search features."],"tags":["schema","grammar","database-driver","postgres","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"}