mirror of
https://github.com/wavelog/wavelog.git
synced 2026-03-22 10:24:14 +00:00
Added error handling for the migration - new cron job will be added only if it was not added before.
This commit is contained in:
@@ -19,7 +19,15 @@ class Migration_add_cron_hamqsl extends CI_Migration {
|
||||
'next_run' => null
|
||||
)
|
||||
);
|
||||
$this->db->insert_batch('cron', $data);
|
||||
|
||||
// Check if the cron job already exists
|
||||
$this->db->where('id', 'update_update_hamqsl');
|
||||
$query = $this->db->get('cron');
|
||||
|
||||
if ($query->num_rows() == 0) {
|
||||
// Insert the cron job only if it does not exist
|
||||
$this->db->insert_batch('cron', $data);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user