File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change 7
7
use BeyondCode \LaravelMaskedDumper \TableDefinitions \TableDefinition ;
8
8
use Doctrine \DBAL \Platforms \MariaDBPlatform ;
9
9
use Doctrine \DBAL \Platforms \MySQLPlatform ;
10
- use Doctrine \DBAL \Platforms \PostgreSQLPlatform ;
11
10
use Doctrine \DBAL \Platforms \SqlitePlatform ;
12
- use Doctrine \DBAL \Platforms \SQLServerPlatform ;
13
11
use Illuminate \Database \Connection as DatabaseConnection ;
14
12
use Doctrine \DBAL \Platforms \AbstractPlatform ;
15
13
@@ -89,12 +87,11 @@ protected function getPlatform(DatabaseConnection $connection)
89
87
return new MySQLPlatform ;
90
88
case 'mariadb ' :
91
89
return new MariaDBPlatform ;
92
- case 'pgsql ' :
93
- return new PostgreSQLPlatform ;
94
- case 'sqlite ' :
95
- return new SqlitePlatform ;
96
90
default :
97
- throw new \RuntimeException ("Unsupported platform: {$ connection ->getDriverName ()}" );
91
+ if ($ connection ->getDriverName () === 'sqlite ' && $ this ->isTesting ()) {
92
+ return new SqlitePlatform ;
93
+ }
94
+ throw new \RuntimeException ("Unsupported platform: {$ connection ->getDriverName ()}. Please check the documentation for more information. " );
98
95
}
99
96
}
100
97
@@ -141,4 +138,8 @@ protected function dumpTableData(TableDefinition $table)
141
138
142
139
return $ query ;
143
140
}
141
+
142
+ protected function isTesting (): bool {
143
+ return config ('app.env ' ) === 'workbench ' || config ('app.env ' ) === 'ci ' ;
144
+ }
144
145
}
You can’t perform that action at this time.
0 commit comments