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

The columns are not removed when uninstalling the module #1

Open
wants to merge 2 commits into
base: 1.x
Choose a base branch
from

Conversation

DhruvBasan
Copy link

@DhruvBasan DhruvBasan commented Dec 8, 2023

Preconditions

Tested on this versions:
1. Magento 2.4.6-p1
2. Magento 2.4.6-p2
3. Module-version 1.2.5

Description

Upon installation of the module, three columns—gift_skus, gift_skus_discount, and gift_sku_qty—are added to the "salesrule" table. Additionally, the column is_gifts is introduced in the "quote_item" table. However, during the uninstallation of the module, these columns are not automatically deleted from the database, which could potentially lead to issues.

Steps to Reproduce

1: In the clean magento shop install the Magesuite-FreeGift module (composer require "creativestyle/magesuite-free-gift" ^1.0.0
and run the php bin/magento s:d:c && php bin/magento s:up)
2: After installing this module three column are added in ‘salesrule’ table the columns are gift_sku, gift_sku_discount, and
gift_sku_qty and in ‘quote_item’ Table the column is_gift is added
3: After try to uninsatll the module from shop using the below command one by one:
a-> php bin/magento module:disable MageSuite_FreeGift
b->php bin/magento s:up
c->php bin/magento module:enable MageSuite_FreeGift
d->php bin/magento module:uninstall -r MageSuite_FreeGift
e->php bin/magento s:up
4: After uninstalling the module check the “salesrule” and ”quote_item” table and the column that generate when we install the
module are not removed from these table when we uninstall the module. In the screenshot below you can see that after
uninstalling the module the columns(gift_sku, gift_sku_discount, and gift_sku_) are still in ‘salesrule’ table
image

Actual Result

When uninstalling the module the column are not removed from database

Expected Result

When we uninstall the module the column should be removed from database

Reason

In the module, only InstallSchema.php and UpgradeSchema.php files have been created. These files add the column when the module is installed, but there is no file to remove these columns when uninstalling the module

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant