diff --git a/install/upgrades/fix_faq_filedownload_modules.php b/install/upgrades/fix_faq_filedownload_modules.php new file mode 100644 index 0000000000..94af26497c --- /dev/null +++ b/install/upgrades/fix_faq_filedownload_modules.php @@ -0,0 +1,78 @@ +tableExists('faqs')) { + if ($db->tableExists('faq') && !$db->countObjects('faq')) { + $db->dropTable('faq'); + } + if (!$db->tableExists('faq')) { + $db->sql('RENAME TABLE '.DB_TABLE_PREFIX.'_faqs TO '.DB_TABLE_PREFIX.'_faq'); + } + } + if ($db->tableExists('filedownloads')) { + if ($db->tableExists('filedownload') && !$db->countObjects('filedownload')) { + $db->dropTable('filedownload'); + } + if (!$db->tableExists('filedownload')) { + $db->sql('RENAME TABLE '.DB_TABLE_PREFIX.'_filedownloads TO '.DB_TABLE_PREFIX.'_filedownload'); + } + } + return gt('faq & filedownload tables are now correctly named.'); + } +} + +?>