Skip to content

Commit 78b796f

Browse files
committed
MAGETWO-56052: MySQL triggers for Indexers not removed after upgrade
1 parent 0f1af99 commit 78b796f

File tree

2 files changed

+58
-1
lines changed

2 files changed

+58
-1
lines changed
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
<?php
2+
/**
3+
* Copyright © 2016 Magento. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
namespace Magento\Indexer\Setup;
8+
9+
use Magento\Framework\Setup\InstallDataInterface;
10+
use Magento\Framework\Setup\ModuleContextInterface;
11+
use Magento\Framework\Setup\ModuleDataSetupInterface;
12+
use Magento\Indexer\Model\IndexerFactory;
13+
use Magento\Framework\Indexer\ConfigInterface;
14+
15+
/**
16+
* Upgrade registered themes
17+
*/
18+
class RecurringData implements InstallDataInterface
19+
{
20+
/**
21+
* @var IndexerFactory
22+
*/
23+
private $indexerFactory;
24+
25+
/**
26+
* @var ConfigInterface
27+
*/
28+
private $configInterface;
29+
30+
/**
31+
* RecurringData constructor.
32+
*
33+
* @param IndexerFactory $indexerFactory
34+
* @param ConfigInterface $configInterface
35+
*/
36+
public function __construct(
37+
IndexerFactory $indexerFactory,
38+
ConfigInterface $configInterface
39+
) {
40+
41+
$this->indexerFactory = $indexerFactory;
42+
$this->configInterface = $configInterface;
43+
}
44+
45+
/**
46+
* {@inheritdoc}
47+
*/
48+
public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
49+
{
50+
foreach (array_keys($this->configInterface->getIndexers()) as $indexerId) {
51+
$indexer = $this->indexerFactory->create()->load($indexerId);
52+
if ($indexer->isScheduled()) {
53+
$indexer->getView()->unsubscribe()->subscribe();
54+
}
55+
}
56+
}
57+
}

lib/internal/Magento/Framework/Mview/etc/mview.xsd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@
106106
<xs:simpleType name="subscriptionModelType">
107107
<xs:annotation>
108108
<xs:documentation>
109-
Subscription model must be a valid PHP class or interface name.
109+
DEPRECATED. Subscription model must be a valid PHP class or interface name.
110110
</xs:documentation>
111111
</xs:annotation>
112112
<xs:restriction base="xs:string">

0 commit comments

Comments
 (0)