{"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/bd6b5437e6ad87bb49f9b426724f07a9f64e9683/src/Illuminate/Database/Schema/Builder.php#L570-L606","documentation":"Base Builder::dropAllViews() throws LogicException because the connected driver's SchemaBuilder does not override it. Only drivers that expose view catalogues (e.g. Postgres, SQL Server, MySQL) implement it; SQLite and incomplete custom drivers do not. It is a declared capability gap.","triggerScenarios":"Calling Schema::dropAllViews() or a test/maintenance script that clears views, while connected through a driver whose builder lacks the override (notably SQLite or a third-party driver).","commonSituations":"Running migrate:fresh -- --views on SQLite; pointing a test suite at SQLite while the migration path tries to drop views; a custom driver missing the method.","solutions":["Use a driver that implements dropAllViews (pgsql, mysql, sqlsrv).","If using SQLite, drop individual views with DB::statement('DROP VIEW IF EXISTS name').","Implement dropAllViews() on your custom Builder subclass."],"exampleFix":"// before\nSchema::dropAllViews();\n\n// after (SQLite or unsupported driver)\nforeach (DB::select(\"SELECT name FROM sqlite_master WHERE type='view'\") as $v) {\n    DB::statement('DROP VIEW IF EXISTS '.$v->name);\n}","handlingStrategy":"type-guard","validationCode":"$builder = Schema::getConnection()->getSchemaBuilder();\nif ((new \\ReflectionMethod($builder, 'dropAllViews'))->getDeclaringClass()->getName()\n    === \\Illuminate\\Database\\Schema\\Builder::class) {\n    // unsupported — skip or fall back\n}","typeGuard":"function driverSupportsDropAllViews(): bool\n{\n    $builder = Schema::getConnection()->getSchemaBuilder();\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    // unsupported driver — skip silently or surface\n}","preventionTips":["Guard dropAllViews() by driver in shared test base classes.","Use Postgres/MySQL/SQL Server when view teardown is required.","Drop individual views with DB::statement('DROP VIEW IF EXISTS ...') on unsupported drivers."],"tags":["schema","database","driver-support","views"],"analyzedSha":"bd6b5437e6ad87bb49f9b426724f07a9f64e9683","analyzedAt":"2026-08-06T00:28:32.783Z","schemaVersion":2}