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

Add a way to keep plugin data when uninstalling #7083

Open
RomanovM opened this issue Feb 19, 2024 · 2 comments
Open

Add a way to keep plugin data when uninstalling #7083

RomanovM opened this issue Feb 19, 2024 · 2 comments

Comments

@RomanovM
Copy link
Contributor

nopCommerce version: 4.60

We need a generic way to keep plugin data when uninstalling to avoid creating such a method in each plugin.

Suggestion: https://www.nopcommerce.com/boards/topic/84184/remove-all-plugin-tables-on-plugin-uninstall-setting

@SelectSystemsInternational

I have two settings in my Plugins

Delete Plugin Tables on Uninstall - If ticked it will delete the tables

  • Does mean you need to implement Up and Down methods and check the setting before deleting tables
  • Need to check if tables exisit before creating on install (which I think is standard now)

Delete Configuration Data on Uninstall - If ticked will delete the settings assicated withthe plugin

  • Need to check if the settings exist before overwriting on install

If ever needed you have to option of completely unistall and delete plugin but not loose config and/or tables

@hoffmanntravis
Copy link

Note: this comment pertains to the Setting table specifically, not files stored on the file system. Our use case is primarily lost Settings row data in the database.

One way to implement this might be to keep the previous settings in another table, or column within the existing table. PreviousSettingValue column, or perhaps setting history linking table with versions and dates. I don't think for most cases the history has to be comprehensive and n - 1 would be adequate.

To me, the overall goal would be if a plugin is uninstalled and then subsequently re-installed it either just takes the last settings or prompts the user to take the last settings. Or maybe add a checkbox to optionally import the previous settings when installing the plugin.

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

No branches or pull requests

3 participants