Skip to content
Snippets Groups Projects
Commit 47413d9c authored by Reinhold Kainhofer's avatar Reinhold Kainhofer
Browse files

On update check if DB table exists before altering it. Fixes #19

parent c2f6fcf4
Branches
Tags
No related merge requests found
......@@ -80,6 +80,11 @@ class plgVmShopperOrdernumberInstallerScript
public function update(JAdapterInstance $adapter)
{
$db = JFactory::getDBO();
$tbl = $db->setQuery('SHOW TABLES like "#__virtuemart_shopper_plg_ordernumber";')->loadObject();
if (!$tbl) {
return true;
}
$db->setQuery('ALTER TABLE `#__virtuemart_shopper_plg_ordernumber` CHANGE `number_type` `number_type` VARCHAR(30) NULL DEFAULT NULL;');
$db->query();
......@@ -115,4 +120,4 @@ class plgVmShopperOrdernumberInstallerScript
$db->setQuery('DROP TABLE IF EXISTS `#__virtuemart_shopper_plg_ordernumber`;');
$db->query();
}
}
\ No newline at end of file
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment