{"id":"bdecaab9bf65242b","repo":"laravel/framework","slug":"this-database-driver-does-not-support-dropping-all-bdecaa","errorCode":null,"errorMessage":"This database driver does not support dropping all types.","messagePattern":"This database driver does not support dropping all types\\.","errorType":"exception","errorClass":"LogicException","httpStatus":null,"severity":"error","filePath":"src/Illuminate/Database/Schema/Builder.php","lineNumber":600,"sourceCode":"     * @return void\n     *\n     * @throws \\LogicException\n     */\n    public function dropAllViews()\n    {\n        throw new LogicException('This database driver does not support dropping all views.');\n    }\n\n    /**\n     * Drop all types from the database.\n     *\n     * @return void\n     *\n     * @throws \\LogicException\n     */\n    public function dropAllTypes()\n    {\n        throw new LogicException('This database driver does not support dropping all types.');\n    }\n\n    /**\n     * Rename a table on the schema.\n     *\n     * @param  string  $from\n     * @param  string  $to\n     * @return void\n     */\n    public function rename($from, $to)\n    {\n        $this->build(tap($this->createBlueprint($from), function ($blueprint) use ($to) {\n            $blueprint->rename($to);\n        }));\n    }\n\n    /**\n     * Enable foreign key constraints.","sourceCodeStart":582,"sourceCodeEnd":618,"githubUrl":"https://github.com/laravel/framework/blob/bd6b5437e6ad87bb49f9b426724f07a9f64e9683/src/Illuminate/Database/Schema/Builder.php#L582-L618","documentation":"Base Builder::dropAllTypes() throws LogicException when the driver's SchemaBuilder has not overridden it. User-defined types (ENUM, composite, domain) are essentially a Postgres concept; this method exists so PostgresBuilder can drop enum/composite types during fresh migrations. Other drivers intentionally leave it unimplemented.","triggerScenarios":"Calling Schema::dropAllTypes(), or having a migration/test path that invokes it, on any connection whose builder is not PostgresBuilder (or another that overrides it).","commonSituations":"Using migrate:fresh with the Postgres-specific PostgresBuilder behavior expected, but connected to MySQL/SQLite; running a shared test base class that calls dropAllTypes unconditionally across connections.","solutions":["Guard the call by driver: only invoke dropAllTypes() when connected to Postgres.","Switch the connection to pgsql if you genuinely need user-defined type teardown.","Remove the call from cross-driver test harnesses."],"exampleFix":"// before\nSchema::dropAllTypes();\n\n// after\nif (DB::connection() instanceof \\Illuminate\\Database\\PostgresConnection) {\n    Schema::dropAllTypes();\n}","handlingStrategy":"type-guard","validationCode":"if (! DB::connection() instanceof \\Illuminate\\Database\\PostgresConnection) {\n    return; // dropAllTypes only meaningful on Postgres\n}\nSchema::dropAllTypes();","typeGuard":"function shouldDropAllTypes(): bool\n{\n    return DB::connection() instanceof \\Illuminate\\Database\\PostgresConnection;\n}","tryCatchPattern":"try {\n    Schema::dropAllTypes();\n} catch (\\LogicException $e) {\n    // non-Postgres driver — nothing to drop\n}","preventionTips":["Reserve dropAllTypes() for Postgres connections.","Do not call it in cross-driver test harnesses.","Switch to pgsql if your migrations rely on user-defined type teardown."],"tags":["schema","database","driver-support","postgres","user-defined-types"],"analyzedSha":"bd6b5437e6ad87bb49f9b426724f07a9f64e9683","analyzedAt":"2026-08-06T00:28:32.783Z","schemaVersion":2}