Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed module uninstall issue #16

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 5 additions & 11 deletions Setup/Patch/Data/CreateProductAttribute.php
Original file line number Diff line number Diff line change
Expand Up @@ -217,11 +217,9 @@ public function revert()
$this->moduleDataSetup->getConnection()->startSetup();

// Deleting category
/* $connection = $this->moduleDataSetup->getConnection();
$connection = $this->moduleDataSetup->getConnection();
$table = $connection->getTableName('core_config_data');
$category = $connection->getConnection()
->query('SELECT value FROM ' . $table . ' WHERE path = "datafeed/icecat/root_category_id"')
->fetch(); */
$category = $connection->query('SELECT value FROM ' . $table . ' WHERE path = "datafeed/icecat/root_category_id"')->fetch();
$categoryId = $this->_scopeConfig->getValue('datafeed/icecat/root_category_id', \Magento\Store\Model\ScopeInterface::SCOPE_STORE);
if (!empty($categoryId)) {
//$categoryId = $category['value'];
Expand All @@ -239,18 +237,14 @@ public function revert()
$subCategory->delete();
}
}
$this->categoryRepository->deleteByIdentifier($categoryId);
}

$this->categoryRepository->deleteByIdentifier($categoryId);
$connection->getConnection()
->query('Delete FROM ' . $table . ' WHERE path like "%datafeed%"')
->fetch();
$connection->query('Delete FROM ' . $table . ' WHERE path like "%datafeed%"')->fetch();

// Deleting patch data from patch_list table
$patchTable = $connection->getTableName('patch_list');
$connection->getConnection()
->query('Delete FROM ' . $patchTable . ' WHERE patch_name like "%Icecat%"')
->fetch();
$connection->query('Delete FROM ' . $patchTable . ' WHERE patch_name like "%Icecat%"')->fetch();

/** @var EavSetup $eavSetup */
$eavSetup = $this->eavSetupFactory->create(['setup' => $this->moduleDataSetup]);
Expand Down
28 changes: 25 additions & 3 deletions etc/db_schema_whitelist.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@
"error_log": true,
"data_size": true,
"created": true,
"locked_at": true
"locked_at": true,
"schedule_unique_id": true
},
"constraint": {
"PRIMARY": true
Expand All @@ -83,7 +84,8 @@
"product_ids": true,
"product_ids_with_missing_gtin_product_code": true,
"ended": true,
"error_log": true
"error_log": true,
"schedule_unique_id": true
},
"constraint": {
"PRIMARY": true
Expand All @@ -96,10 +98,30 @@
"data": true,
"error_log": true,
"data_size": true,
"created_at": true,
"schedule_unique_id": true
},
"constraint": {
"PRIMARY": true
}
},
"icecat_queue_scheduler": {
"column": {
"id": true,
"started": true,
"ended": true,
"type": true,
"status": true,
"product_updated": true,
"product_failed": true,
"queue_mode": true,
"cron_expression": true,
"cron_run_time": true,
"schedule_unique_id": true,
"created_at": true
},
"constraint": {
"PRIMARY": true
}
}
}
}