Skip to content

Commit 3267af2

Browse files
author
Volodymyr Klymenko
authored
Merge pull request #261 from magento-falcons/MAGETWO-56974-2-1
Fixed - MAGETWO-56974 Can not upgrade Magento 2.0.9 to 2.1.1 with sample data
2 parents 207e965 + c274ad6 commit 3267af2

File tree

2 files changed

+31
-18
lines changed

2 files changed

+31
-18
lines changed

setup/src/Magento/Setup/Model/Installer.php

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -777,6 +777,7 @@ public function installSchema()
777777
$this->setupCoreTables($setup);
778778
$this->log->log('Schema creation/updates:');
779779
$this->handleDBSchemaData($setup, 'schema');
780+
$this->cleanDdlCache();
780781
}
781782

782783
/**
@@ -1070,8 +1071,6 @@ private function enableCaches()
10701071
* Clean caches after installing application
10711072
*
10721073
* @return void
1073-
*
1074-
* @SuppressWarnings(PHPMD.UnusedPrivateMethod) Called by install() via callback.
10751074
*/
10761075
private function cleanCaches()
10771076
{
@@ -1082,6 +1081,19 @@ private function cleanCaches()
10821081
$this->log->log('Cache cleared successfully');
10831082
}
10841083

1084+
/**
1085+
* Clean DDL cache
1086+
*
1087+
* @return void
1088+
*/
1089+
private function cleanDdlCache()
1090+
{
1091+
/** @var \Magento\Framework\App\Cache\Manager $cacheManager */
1092+
$cacheManager = $this->objectManagerProvider->get()->get(\Magento\Framework\App\Cache\Manager::class);
1093+
$cacheManager->clean([\Magento\Framework\DB\Adapter\DdlCache::TYPE_IDENTIFIER]);
1094+
$this->log->log('DDL cache cleared successfully');
1095+
}
1096+
10851097
/**
10861098
* Enables or disables maintenance mode for Magento application
10871099
*

setup/src/Magento/Setup/Test/Unit/Model/InstallerTest.php

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -304,22 +304,23 @@ public function testInstall()
304304
$this->logger->expects($this->at(15))->method('log')->with('Schema post-updates:');
305305
$this->logger->expects($this->at(16))->method('log')->with("Module 'Foo_One':");
306306
$this->logger->expects($this->at(18))->method('log')->with("Module 'Bar_Two':");
307-
$this->logger->expects($this->at(21))->method('log')->with('Installing user configuration...');
308-
$this->logger->expects($this->at(23))->method('log')->with('Enabling caches:');
309-
$this->logger->expects($this->at(27))->method('log')->with('Installing data...');
310-
$this->logger->expects($this->at(28))->method('log')->with('Data install/update:');
311-
$this->logger->expects($this->at(29))->method('log')->with("Module 'Foo_One':");
312-
$this->logger->expects($this->at(31))->method('log')->with("Module 'Bar_Two':");
313-
$this->logger->expects($this->at(33))->method('log')->with('Data post-updates:');
314-
$this->logger->expects($this->at(34))->method('log')->with("Module 'Foo_One':");
315-
$this->logger->expects($this->at(36))->method('log')->with("Module 'Bar_Two':");
316-
$this->logger->expects($this->at(39))->method('log')->with('Installing admin user...');
317-
$this->logger->expects($this->at(41))->method('log')->with('Caches clearing:');
318-
$this->logger->expects($this->at(44))->method('log')->with('Disabling Maintenance Mode:');
319-
$this->logger->expects($this->at(46))->method('log')->with('Post installation file permissions check...');
320-
$this->logger->expects($this->at(48))->method('log')->with('Write installation date...');
321-
$this->logger->expects($this->at(50))->method('logSuccess')->with('Magento installation complete.');
322-
$this->logger->expects($this->at(52))->method('log')
307+
$this->logger->expects($this->at(20))->method('log')->with('DDL cache cleared successfully');
308+
$this->logger->expects($this->at(22))->method('log')->with('Installing user configuration...');
309+
$this->logger->expects($this->at(24))->method('log')->with('Enabling caches:');
310+
$this->logger->expects($this->at(28))->method('log')->with('Installing data...');
311+
$this->logger->expects($this->at(29))->method('log')->with('Data install/update:');
312+
$this->logger->expects($this->at(30))->method('log')->with("Module 'Foo_One':");
313+
$this->logger->expects($this->at(32))->method('log')->with("Module 'Bar_Two':");
314+
$this->logger->expects($this->at(34))->method('log')->with('Data post-updates:');
315+
$this->logger->expects($this->at(35))->method('log')->with("Module 'Foo_One':");
316+
$this->logger->expects($this->at(37))->method('log')->with("Module 'Bar_Two':");
317+
$this->logger->expects($this->at(40))->method('log')->with('Installing admin user...');
318+
$this->logger->expects($this->at(42))->method('log')->with('Caches clearing:');
319+
$this->logger->expects($this->at(45))->method('log')->with('Disabling Maintenance Mode:');
320+
$this->logger->expects($this->at(47))->method('log')->with('Post installation file permissions check...');
321+
$this->logger->expects($this->at(49))->method('log')->with('Write installation date...');
322+
$this->logger->expects($this->at(51))->method('logSuccess')->with('Magento installation complete.');
323+
$this->logger->expects($this->at(53))->method('log')
323324
->with('Sample Data is installed with errors. See log file for details');
324325
$this->object->install($request);
325326
}

0 commit comments

Comments
 (0)