Disable strict mode before running migrations

This will ensure strict mode is not applied while running migrations
for both modules and plugins, either when installing or removing.

We don't need to call disableStrictMode from UpdateManager::uninstall()
as it is called within the plugin removal methods, which are run first.

To force strict mode to be enabled, set 'strict' => true in the database config.
This commit is contained in:
Dave Shoreman 2016-04-29 18:39:26 +01:00
parent 48090351bd
commit e2b110a611
2 changed files with 6 additions and 0 deletions

View File

@ -366,6 +366,8 @@ class UpdateManager
*/
public function migrateModule($module)
{
DbDongle::disableStrictMode();
$this->migrator->run(base_path() . '/modules/'.strtolower($module).'/database/migrations');
$this->note($module);

View File

@ -385,6 +385,8 @@ class VersionManager
*/
protected function applyDatabaseScript($code, $version, $script)
{
DbDongle::disableStrictMode();
/*
* Execute the database PHP script
*/
@ -405,6 +407,8 @@ class VersionManager
*/
protected function removeDatabaseScript($code, $version, $script)
{
DbDongle::disableStrictMode();
/*
* Execute the database PHP script
*/