run it from plugin installation method directly to Ms Sql
What do you mean by that? I mean, let's say the client has a brand new installation of NopCommerce. He installs my plugin, let's say version 1.0. The tables get created. From then on, the client enters some data. Then, some months later, I release version 1.1 which has 2 more tables and 2 new fields in one of the old tables. What are the options? Does the client just copy the new version in the plugin's directory and restart NopCommerce? Is there an "Update" method? Will NopCommerce call the "Install" method again because it recognizes it's a new version?
I'm pretty new to this. Usually, I develop a plugin for a specific client and manage it myself, so when I have update scripts, I run them myself on the client's server. But now, I have a client through one of my clients, so I don't really have access to the client's server. As a result, someone, not necessarily very tech-savvy will have to install updates.
Thanks a lot for your help. It's very appreciated.
Dany Latulippe
What do you mean by that? I mean, let's say the client has a brand new installation of NopCommerce. He installs my plugin, let's say version 1.0. The tables get created. From then on, the client enters some data. Then, some months later, I release version 1.1 which has 2 more tables and 2 new fields in one of the old tables. What are the options? Does the client just copy the new version in the plugin's directory and restart NopCommerce? Is there an "Update" method? Will NopCommerce call the "Install" method again because it recognizes it's a new version?
I'm pretty new to this. Usually, I develop a plugin for a specific client and manage it myself, so when I have update scripts, I run them myself on the client's server. But now, I have a client through one of my clients, so I don't really have access to the client's server. As a result, someone, not necessarily very tech-savvy will have to install updates.
Thanks a lot for your help. It's very appreciated.
Dany Latulippe
Hi Dany,
You can add a plugin setting for display upgrade plugin/database button in plugin configuration page.
and execute script for the tables on click of button, once script execute successfully than mark false to new setting and hide that button.
If you execute scripts on plugin installation time without drop old tables than whenever you install plugin next time, it'll throws exception or create duplicate record because of that script is already execute on first time plugin installation.