Module won't rebuild database tables

May 6, 2011 at 8:09 PM

I installed this module, and then uninstalled it. In doing so, I also deleted the tables from the database. I reinstalled the module, but the tables were not recreated. How do you force the module to rebuild the tables?

Coordinator
May 9, 2011 at 11:32 AM

Hello!

Thanks for your feedback. I think this is a Orchard issue. I guess that module uninstallation is not really supported by Orchard at the moment.

Since you already deleted the tables, try the following command on Orchard console:

package uninstall Mello.ImageGallery

Also, there's a User Voice request to implent this feature:

http://orchard.uservoice.com/forums/50435-general/suggestions/1394211-clean-module-removal?ref=title

Regards,

Gabriel Mello

Jul 21, 2011 at 7:59 PM

You didn't really answer his question and I have the same issue... I installed the module, did some testing and something I did caused an error whenever I tried to access the ImageGallery in the admin. So I wanted to completely reinstall it. I uninstalled the module from the console and deleted the database tables but now when I reinstall it the database tables are not recreated. Is there a way to force it to create the db tables?

Coordinator
Jul 21, 2011 at 8:12 PM

Hi,

Sorry for the inconvenience. Have you tried to delete the ImageGallery folder inside the media folder? Maybe there's something there that is preventing you from reinstalling.

Could you provide the error message/stacktrace?

Thanks!

Gabriel Mello

Jul 21, 2011 at 8:56 PM

After I uninstalled the module I also manually deleted the 3 tables from the database: Mello_ImageGallery_ImageGallerySettingsRecord, Mello_ImageGallery_ImageGalleryRecord and Mello_ImageGallery_ImageGalleryImageSettingsRecord. I then reinstalled the ImageGallery module. Those three database tables were not recreated. Now when I try to add a new image gallery in the admin I get System.Data.SqlClient.SqlException: Invalid object name 'test_Mello_ImageGallery_ImageGallerySettingsRecord'. Because the tables do not exist in the database. Is there a way to recreate the database tables your module needs?