From a052951bfd9994cc89a3c9042c5c09a3c19aa1de Mon Sep 17 00:00:00 2001 From: Peter Goodhall Date: Tue, 7 Jan 2025 13:16:23 +0000 Subject: [PATCH] Fixes issue #3247 --- .../migrations/177_add_dxped_url_option.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/application/migrations/177_add_dxped_url_option.php b/application/migrations/177_add_dxped_url_option.php index d461ec87..cfbec47f 100644 --- a/application/migrations/177_add_dxped_url_option.php +++ b/application/migrations/177_add_dxped_url_option.php @@ -11,11 +11,17 @@ class Migration_add_dxped_url_option extends CI_Migration { public function up() { - $data = array( - array('option_name' => "dxped_url", 'option_value' => "https://cdn.cloudlog.org/read_ng3k_dxped_list.php", 'autoload' => "yes"), - ); + // Check if dxped_url is already in the options table + if ($this->db->where('option_name', 'dxped_url')->count_all_results('options') == 0) { + // Insert dxped_url option + $data = array( + 'option_name' => "dxped_url", + 'option_value' => "https://cdn.cloudlog.org/read_ng3k_dxped_list.php", + 'autoload' => "yes" + ); + $this->db->insert('options', $data); + } - $this->db->insert_batch('options', $data); } public function down()