mirror of
https://github.com/wavelog/wavelog.git
synced 2026-03-22 10:24:14 +00:00
error handling
This commit is contained in:
@@ -14,14 +14,22 @@ class Migration_fix_dbcollate_again extends CI_Migration
|
|||||||
'vuccgrids'
|
'vuccgrids'
|
||||||
);
|
);
|
||||||
foreach ($tables as $table) {
|
foreach ($tables as $table) {
|
||||||
$this->db->query('ALTER TABLE ' . $table . ' CONVERT TO CHARACTER SET ' . $this->db->char_set . ' COLLATE ' . $this->db->dbcollat); // fix existing tables that haven't already been fixed
|
$this->dbtry('ALTER TABLE ' . $table . ' CONVERT TO CHARACTER SET ' . $this->db->char_set . ' COLLATE ' . $this->db->dbcollat); // fix existing tables that haven't already been fixed
|
||||||
}
|
}
|
||||||
$this->db->query('ALTER DATABASE `' . $this->db->database . '` CHARACTER SET ' . $this->db->char_set . ' COLLATE ' . $this->db->dbcollat); // fix the database default
|
$this->dbtry('ALTER DATABASE `' . $this->db->database . '` CHARACTER SET ' . $this->db->char_set . ' COLLATE ' . $this->db->dbcollat); // fix the database default
|
||||||
}
|
}
|
||||||
|
|
||||||
public function down()
|
public function down()
|
||||||
{
|
{
|
||||||
// Not Possible
|
// Not Possible
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function dbtry($what) {
|
||||||
|
try {
|
||||||
|
$this->db->query($what);
|
||||||
|
} catch (Exception $e) {
|
||||||
|
log_message("error", "Error setting character set/collation: ".$e." // Executing: ".$this->db->last_query());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
Reference in New Issue
Block a user