{"record":{"id":"c453b0ffca39bb12","repo":"laravel/framework","slug":"this-database-driver-does-not-support-dropping-all-c453b0","errorCode":null,"errorMessage":"This database driver does not support dropping all views.","messagePattern":"This database driver does not support dropping all views\\.","errorType":"exception","errorClass":"LogicException","httpStatus":null,"severity":"error","filePath":"src/Illuminate/Database/Schema/Builder.php","lineNumber":588,"sourceCode":"     * @return void\n     *\n     * @throws \\LogicException\n     */\n    public function dropAllTables()\n    {\n        throw new LogicException('This database driver does not support dropping all tables.');\n    }\n\n    /**\n     * Drop all views from the database.\n     *\n     * @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","sourceCodeStart":570,"sourceCodeEnd":606,"githubUrl":"https://github.com/laravel/framework/blob/e0f6eb3518ac29fbbca8529e97d0df7fc9f24481/src/Illuminate/Database/Schema/Builder.php#L570-L606","documentation":"Base Schema\\Builder::dropAllViews() is a LogicException stub; views can only be dropped via engine-specific DDL. MySqlBuilder, SQLiteBuilder, PostgresBuilder, and SqlServerBuilder override it; the base class exists so unsupported drivers fail loudly rather than silently no-op. Hitting it means the active connection's Builder is the base type or a subclass that did not override the method.","triggerScenarios":"Calling Schema::dropAllViews() or a migration/command path that invokes it on a connection whose Builder lacks the override. Typically reached from a custom DBAL driver, or from user code that assumes every engine exposes views.","commonSituations":"Third-party/community driver that extends Builder without implementing dropAllViews; running a DB sanitization or teardown script against such a driver; test teardown that calls dropAllViews on a mocked base Builder.","solutions":["Run the operation against a mysql/pgsql/sqlite/sqlsrv connection where the Builder overrides dropAllViews.","If you own the driver, implement dropAllViews() in its Builder with the correct DROP VIEW statement.","Drop named views explicitly via raw DB::statement('DROP VIEW IF EXISTS ...')."],"exampleFix":"// before\nSchema::connection('redshift_bridge')->dropAllViews();\n\n// after\nDB::connection('redshift_bridge')->statement('DROP VIEW IF EXISTS v_orders, v_users CASCADE');","handlingStrategy":"type-guard","validationCode":"$builder = Schema::getConnection()->getSchemaBuilder();\nif ((new \\ReflectionMethod($builder, 'dropAllViews'))->getDeclaringClass()->getName() === \\Illuminate\\Database\\Schema\\Builder::class) {\n    throw new \\DomainException('This connection does not support dropAllViews.');\n}","typeGuard":"function supportsDropAllViews(\\Illuminate\\Database\\Schema\\Builder $builder): bool\n{\n    return (new \\ReflectionMethod($builder, 'dropAllViews'))\n        ->getDeclaringClass()->getName() !== \\Illuminate\\Database\\Schema\\Builder::class;\n}","tryCatchPattern":"try {\n    Schema::dropAllViews();\n} catch (\\LogicException $e) {\n    DB::statement('DROP VIEW IF EXISTS v_orders, v_users'); // engine-specific fallback\n}","preventionTips":["Treat dropAllViews as engine-specific; never call it blindly across all connections.","Document which connections expose views in your app's capability map.","Prefer named DROP VIEW statements when the set of views is known."],"tags":["schema","database-driver","views","logic-exception"],"backgroundTag":null,"analyzedSha":"e0f6eb3518ac29fbbca8529e97d0df7fc9f24481","analyzedAt":"2026-08-11T20:52:37.562Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}