mirror of
https://github.com/silverstripe/silverstripe-postgresql
synced 2024-10-22 17:05:45 +02:00
FIX Ensure test state only applies when the PostgreSQL connector is configured
This commit is contained in:
parent
6b5a18503a
commit
65c7978555
@ -5,6 +5,8 @@ namespace SilverStripe\PostgreSQL\Dev\State;
|
||||
use SilverStripe\Core\Config\Config;
|
||||
use SilverStripe\Dev\SapphireTest;
|
||||
use SilverStripe\Dev\State\TestState;
|
||||
use SilverStripe\ORM\DB;
|
||||
use SilverStripe\PostgreSQL\PostgreSQLConnector;
|
||||
use SilverStripe\PostgreSQL\PostgreSQLSchemaManager;
|
||||
|
||||
class DisableVacuumState implements TestState
|
||||
@ -36,7 +38,9 @@ class DisableVacuumState implements TestState
|
||||
*/
|
||||
public function setUpOnce($class)
|
||||
{
|
||||
Config::modify()->set(PostgreSQLSchemaManager::class, 'check_and_repair_on_build', false);
|
||||
if (DB::get_conn()->getConnector() instanceof PostgreSQLConnector) {
|
||||
Config::modify()->set(PostgreSQLSchemaManager::class, 'check_and_repair_on_build', false);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user