Skip to content

Commit 6368e1e

Browse files
committed
MAGETWO-87551: Convert existing data install/upgrade scripts
- refactoring of infra to use setup
1 parent d9edf1e commit 6368e1e

File tree

102 files changed

+236
-160
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

102 files changed

+236
-160
lines changed

app/code/Magento/Analytics/Setup/Patch/Data/PrepareInitialConfig.php

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
use Magento\Analytics\Model\Config\Backend\Enabled\SubscriptionHandler;
1010
use Magento\Framework\App\ResourceConnection;
11+
use Magento\Framework\Setup\ModuleDataSetupInterface;
1112
use Magento\Setup\Model\Patch\DataPatchInterface;
1213
use Magento\Setup\Model\Patch\PatchVersionInterface;
1314

@@ -19,27 +20,27 @@
1920
class PrepareInitialConfig implements DataPatchInterface, PatchVersionInterface
2021
{
2122
/**
22-
* @var ResourceConnection
23+
* @var ModuleDataSetupInterface
2324
*/
24-
private $resourceConnection;
25+
private $moduleDataSetup;
2526

2627
/**
2728
* PrepareInitialConfig constructor.
28-
* @param ResourceConnection $resourceConnection
29+
* @param ModuleDataSetupInterface $moduleDataSetup
2930
*/
3031
public function __construct(
31-
ResourceConnection $resourceConnection
32+
ModuleDataSetupInterface $moduleDataSetup
3233
) {
33-
$this->resourceConnection = $resourceConnection;
34+
$this->moduleDataSetup = $moduleDataSetup;
3435
}
3536

3637
/**
3738
* {@inheritdoc}
3839
*/
3940
public function apply()
4041
{
41-
$this->resourceConnection->getConnection()->insertMultiple(
42-
$this->resourceConnection->getConnection()->getTableName('core_config_data'),
42+
$this->moduleDataSetup->getConnection()->insertMultiple(
43+
$this->moduleDataSetup->getConnection()->getTableName('core_config_data'),
4344
[
4445
[
4546
'scope' => 'default',
@@ -56,8 +57,8 @@ public function apply()
5657
]
5758
);
5859

59-
$this->resourceConnection->getConnection()->insert(
60-
$this->resourceConnection->getConnection()->getTableName('flag'),
60+
$this->moduleDataSetup->getConnection()->insert(
61+
$this->moduleDataSetup->getConnection()->getTableName('flag'),
6162
[
6263
'flag_code' => SubscriptionHandler::ATTEMPTS_REVERSE_COUNTER_FLAG_CODE,
6364
'state' => 0,
@@ -78,7 +79,7 @@ public static function getDependencies()
7879
/**
7980
* {@inheritdoc}
8081
*/
81-
public function getVersion()
82+
public static function getVersion()
8283
{
8384
return '2.0.0';
8485
}

app/code/Magento/Authorization/Setup/Patch/Data/InitializeAuthRoles.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ public static function getDependencies()
118118
/**
119119
* {@inheritdoc}
120120
*/
121-
public function getVersion()
121+
public static function getVersion()
122122
{
123123
return '2.0.0';
124124
}

app/code/Magento/Braintree/Setup/Patch/Data/ConvertSerializedDataToJson.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public static function getDependencies()
9595
/**
9696
* {@inheritdoc}
9797
*/
98-
public function getVersion()
98+
public static function getVersion()
9999
{
100100
return '2.0.1';
101101
}

app/code/Magento/Bundle/Setup/Patch/Data/ApplyAttributesUpdate.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ public static function getDependencies()
224224
/**
225225
* {@inheritdoc}
226226
*/
227-
public function getVersion()
227+
public static function getVersion()
228228
{
229229
return '2.0.0';
230230
}

app/code/Magento/Bundle/Setup/Patch/Data/UpdateBundleRelatedEntityTytpes.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ public static function getDependencies()
188188
/**
189189
* {@inheritdoc}
190190
*/
191-
public function getVersion()
191+
public static function getVersion()
192192
{
193193
return '2.0.2';
194194
}

app/code/Magento/Bundle/Setup/Patch/Data/UpdateBundleRelatedSchema.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ public static function getDependencies()
147147
/**
148148
* {@inheritdoc}
149149
*/
150-
public function getVersion()
150+
public static function getVersion()
151151
{
152152
return '2.0.4';
153153
}

app/code/Magento/Catalog/Setup/Patch/Data/ChangePriceAttributeDefaultScope.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public static function getDependencies()
8484
/**
8585
* {@inheritdoc}
8686
*/
87-
public function getVersion()
87+
public static function getVersion()
8888
{
8989
return '2.1.3';
9090
}

app/code/Magento/Catalog/Setup/Patch/Data/DisallowUsingHtmlForProductName.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public static function getDependencies()
7070
/**
7171
* {@inheritdoc}
7272
*/
73-
public function getVersion()
73+
public static function getVersion()
7474
{
7575
return '2.1.5';
7676
}

app/code/Magento/Catalog/Setup/Patch/Data/InstallDefaultCategories.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ public static function getDependencies()
352352
/**
353353
* {@inheritdoc}
354354
*/
355-
public function getVersion()
355+
public static function getVersion()
356356
{
357357
return '2.0.0';
358358
}

app/code/Magento/Catalog/Setup/Patch/Data/RemoveGroupPrice.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public static function getDependencies()
9090
/**
9191
* {@inheritdoc}
9292
*/
93-
public function getVersion()
93+
public static function getVersion()
9494
{
9595
return '2.0.1';
9696
}

0 commit comments

Comments
 (0)