3

I have created the Magento extension. I have installed and uninstalled it. During the uninstallation, what I found that the associated database tables are not being deleted and the settings from the core_config_data and core_resource. Can somebody help me?

2 Answers 2

6

When removing files of an extension, the data stored in the database (dedicated tables and config in core_config_data) are not deleted.

To do this, you have two choice, create a sql upgrade setup to delete those entries, and upgrade your extension, or manually do it in phpmyadmin.

Even if it's not recommanded, I always use the second one, I just run queries likes

DROP TABLE 'mytable';
DELETE FROM 'core_config_data' WHERE path LIKE '%mymodule%';

Of course the cleanest way would be the other, create these request in a sql file upgrade from your version to the next and run it by upgrading the version in the etc/config.xml on the extension.

If the extension is not yours, I suggest to look at system.xml and/or other xml files from the etc/ folder of your module to find informations store in core_config_data, then in all files from the sql/ folder to find other information (table, columns, row added).

1
  • Can you tell me that how can i define the upgrade in the config.xml file? Thanks
    – tinkesh
    Mar 28, 2013 at 17:36
2

With some extensions an additional attribute related entry to is added. So apart from removing entry from core_config_data this also needs to be removed.

$eav->addAttribute('customer', 'some_property', array(
    'label'     => 'some label',
    'type'      => 'varchar',
    'input'     => 'text',
    'visible'   => true,
    'required'  => true,
    'position'  => 1,
));
1
  • yes +1 for you it was my point, table, column or rows can be added via sql setup, so it could be drop a table, alter a table to remove a column or just delete some rows
    – dagfr
    Mar 5, 2013 at 19:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.