I have a plugin where I give the user the option to keep the table during un-installation. Then the user can keep all of the data and install the plugin at a later date with all the data intact.
The problem is that when the user installs the plugin again then an error is thrown because the database script tries to create a table that already exists.
I have been trying to figure out how to check if the table exists before trying to install the table but to no avail. Currently I simply catch the exception and check if the message contains a certain sentence to ignore that exception or rethrow it. It works but it is ugly.
So the question is, is there any nice method to check for the existence of a table in NopCommerce?
I imagine something like:
Database.TableExists(string nameOfTableToCheck)
Thanks!