I created a plugin as v1.0. Now that I have added more stuff to the plugin and additional columns in the plugin table. How can I update the plugin on site that is running my plugin v1.0?
In my test solution when i try to install the plugin v2.0 (after uninstalling v1.0), i get this error-
"The model backing the 'MyDbContext' context has changed since the database was created"
What can i do to make the v2.0 work (install) with no error and what can i do to update the plugin on site running my plugin v1.0?
What i don't understand is that when uninstalling my plugin v1.0 also deleted the database table and v2.0 should create new tables in database why it will still reference old plugin model?
What and where is the 'MyDbContext' and it keeps the old plugin stuff?
If someone can explain this for my understanding and provide solution would be appreciated
If I add that code in the Plugin then I won't get the error?
If I delete the entry of old plugin v1.0 from the migration database table then I can install v2.0 without making changes in the code?
What about the sites that are using my plugin v1.0 because installing or deleting tables is not an option due to production data? I was thinking running a SQL script on v1.0 Plugin tables in DB to add additional columns but that will only take care of database table not the updated model. What to do then?
What about the sites that are using my plugin v1.0 because installing or deleting tables is not an option due to production data? I was thinking running a SQL script on v1.0 Plugin tables in DB to add additional columns but that will only take care of database table not the updated model. What to do then?
I haven't said to delete your actual plugin table. if you update it manually, then do not worry about model, because it'll match with database fields.
If i add "drop this table" on plugin v1.0 uninstall event, will it be a OK?
Migrations history table is a table used by Code First Migrations to store details about migrations applied to the database. Drop table wouldn't be a proper way. How to handle it from code(OnModelCreating) that what is stated in my first post.
Hi I am not using plugin creation approach as describe in Nopcommerce. I am using simple code first approach in plugin creation and not able to use that method on model creating. Can you please describe any other way where we need not to delete migration table and can update plugin.