[eluser]aidehua[/eluser]
This tweak seems to do the job - but it might not be the best way to do it:
In /system/database/DB_forge.php, I've changed the create_database function to the following:
Code:
/**
* Create database
*
* @access public
* @param string the database name
* @param bool insert "if not exists" clause
* @return bool
*/
function create_database($db_name, $ifnotexists = false)
{
if($ifnotexists){
$db_name = "IF NOT EXISTS " . $db_name;
}
$sql = $this->_create_database($db_name);
if (is_bool($sql))
{
return $sql;
}
return $this->db->query($sql);
}
(The original un-altered function looked like this
Code:
/**
* Create database
*
* @access public
* @param string the database name
* @return bool
*/
function create_database($db_name)
{
$sql = $this->_create_database($db_name);
if (is_bool($sql))
{
return $sql;
}
return $this->db->query($sql);
}
Any other/better suggestions would be welcome. (As I understand it, it is not possible to extend the DB_forge class in the way you can extend other CI classes by creating a MY_class_name class in the application directory.)