File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed
src/Mouf/Database/Patcher Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -154,7 +154,7 @@ protected function saveDbSchema()
154154 {
155155 $ schema = $ this ->patchConnection ->getConnection ()->getSchemaManager ()->createSchema ();
156156 file_put_contents (__DIR__ .'/../../../../generated/schema ' , serialize ($ schema ));
157- chmod (__DIR__ .'/../../../../generated/schema ' , 0664 );
157+ @ chmod (__DIR__ .'/../../../../generated/schema ' , 0664 );
158158 }
159159
160160 /**
Original file line number Diff line number Diff line change 2121namespace Mouf \Database \Patcher ;
2222
2323use Doctrine \DBAL \Connection ;
24+ use Doctrine \DBAL \Driver \AbstractMySQLDriver ;
2425use Mouf \Utils \Patcher \PatchListenerInterface ;
2526
2627
@@ -102,5 +103,9 @@ public function onReset(): void
102103 // Let's drop and recreate the database from 0!
103104 $ dbName = $ this ->dbalConnection ->getDatabase ();
104105 $ this ->dbalRootConnection ->getSchemaManager ()->dropAndCreateDatabase ($ dbName );
106+
107+ if ($ this ->dbalRootConnection ->getDriver () instanceof AbstractMySQLDriver) {
108+ $ this ->dbalRootConnection ->exec ('USE ' .$ dbName );
109+ }
105110 }
106111}
You can’t perform that action at this time.
0 commit comments