File tree 2 files changed +6
-1
lines changed
src/Mouf/Database/Patcher
2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -154,7 +154,7 @@ protected function saveDbSchema()
154
154
{
155
155
$ schema = $ this ->patchConnection ->getConnection ()->getSchemaManager ()->createSchema ();
156
156
file_put_contents (__DIR__ .'/../../../../generated/schema ' , serialize ($ schema ));
157
- chmod (__DIR__ .'/../../../../generated/schema ' , 0664 );
157
+ @ chmod (__DIR__ .'/../../../../generated/schema ' , 0664 );
158
158
}
159
159
160
160
/**
Original file line number Diff line number Diff line change 21
21
namespace Mouf \Database \Patcher ;
22
22
23
23
use Doctrine \DBAL \Connection ;
24
+ use Doctrine \DBAL \Driver \AbstractMySQLDriver ;
24
25
use Mouf \Utils \Patcher \PatchListenerInterface ;
25
26
26
27
@@ -102,5 +103,9 @@ public function onReset(): void
102
103
// Let's drop and recreate the database from 0!
103
104
$ dbName = $ this ->dbalConnection ->getDatabase ();
104
105
$ this ->dbalRootConnection ->getSchemaManager ()->dropAndCreateDatabase ($ dbName );
106
+
107
+ if ($ this ->dbalRootConnection ->getDriver () instanceof AbstractMySQLDriver) {
108
+ $ this ->dbalRootConnection ->exec ('USE ' .$ dbName );
109
+ }
105
110
}
106
111
}
You can’t perform that action at this time.
0 commit comments