Skip to content

Commit

Permalink
Merge pull request #113 from blmage/master
Browse files Browse the repository at this point in the history
Switch from setup scripts to declarative schema
  • Loading branch information
blmage committed Apr 27, 2022
2 parents 0904464 + 423052e commit 7ecdee7
Show file tree
Hide file tree
Showing 11 changed files with 851 additions and 2,517 deletions.
15 changes: 13 additions & 2 deletions Model/Account/Store/ConfigManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,15 @@ public function importStoreData(StoreInterface $store, array $data)
*/
public function upgradeStoreData(StoreInterface $store, $moduleVersion)
{
$originalConfigData = $store->getConfiguration()->getData();
$oldVersion = $store->getConfiguration()
->getDataByKey('version');

if (
!empty($oldVersion)
&& (version_compare($oldVersion, $moduleVersion) >= 0)
) {
return false;
}

$this->feedGeneralConfig->upgradeStoreData($store, $this, $moduleVersion);
$this->feedExportStateConfig->upgradeStoreData($store, $this, $moduleVersion);
Expand All @@ -158,6 +166,9 @@ public function upgradeStoreData(StoreInterface $store, $moduleVersion)

$this->orderGeneralConfig->upgradeStoreData($store, $this, $moduleVersion);

return $store->getConfiguration()->getData() !== $originalConfigData;
$store->getConfiguration()
->setData('version', $moduleVersion);

return true;
}
}
Loading

0 comments on commit 7ecdee7

Please sign in to comment.