| 
									
										
										
										
											2024-04-05 01:49:18 +08:00
										 |  |  | <?php | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | defined('BASEPATH') OR exit('No direct script access allowed'); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /* | 
					
						
							|  |  |  |  *  This migration adds a dxped_url-key to the options table, to configure | 
					
						
							|  |  |  |  *  the endpoint, from where the dxpedition-data is being loaded. | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-04-09 21:24:30 +08:00
										 |  |  | class Migration_add_dxped_url_option extends CI_Migration { | 
					
						
							| 
									
										
										
										
											2024-04-05 01:49:18 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  |     public function up() | 
					
						
							|  |  |  |     { | 
					
						
							| 
									
										
										
										
											2025-01-07 21:16:23 +08:00
										 |  |  |         // 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); | 
					
						
							|  |  |  |         } | 
					
						
							| 
									
										
										
										
											2024-04-05 01:49:18 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     public function down() | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         // No option to down
 | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | } |