Skip to content

Commit

Permalink
Migrate fabrik_ratings if it exists... if not then gently move along …
Browse files Browse the repository at this point in the history
…please! You may wish to cleanup code! ;)
  • Loading branch information
felixkat committed Jan 13, 2012
1 parent 818fcfe commit fa074ab
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions administrator/components/com_fabrik/models/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,22 @@ protected function upgrade(){
}
}
}

//run fabrik ratings outside mysql script as it may not exist and error
$db = JFactory::getDBO();
// Check if #__fabrik_ratings table exists
$fabrate = "SHOW TABLES LIKE '".$prefix."fabrik_ratings'";
$db->setQuery($fabrate);
$rateresult = $db->loadObjectList();
if (!count($rateresult)) {
}
else
{
$db->setQuery ("ALTER TABLE ".$prefix."fabrik_ratings CHANGE `tableid` `listid` INT( 6 ) NOT NULL");
$db->query();

}

}

/**
Expand Down

0 comments on commit fa074ab

Please sign in to comment.