| 
									
										
										
										
											2025-08-18 21:07:43 +08:00
										 |  |  | <?php defined('BASEPATH') or exit('No direct script access allowed'); | 
					
						
							| 
									
										
										
										
											2013-02-27 12:04:35 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-08-18 21:07:43 +08:00
										 |  |  | class Migration_add_config_table extends CI_Migration | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2013-02-27 12:04:35 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  |         public function up() | 
					
						
							|  |  |  |         { | 
					
						
							| 
									
										
										
										
											2025-08-18 21:07:43 +08:00
										 |  |  |                 $this->dbforge->add_field('id'); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-02-27 12:04:35 +08:00
										 |  |  |                 $this->dbforge->add_field(array( | 
					
						
							|  |  |  |                         'lotw_download_url' => array( | 
					
						
							|  |  |  |                                 'type' => 'VARCHAR', | 
					
						
							|  |  |  |                                 'constraint' => 255, | 
					
						
							|  |  |  |                         ), | 
					
						
							|  |  |  |                         'lotw_upload_url' => array( | 
					
						
							|  |  |  |                                 'type' => 'VARCHAR', | 
					
						
							|  |  |  |                                 'constraint' => 255, | 
					
						
							|  |  |  |                         ), | 
					
						
							| 
									
										
										
										
											2025-08-18 21:07:43 +08:00
										 |  |  |                         'lotw_rcvd_mark' => array( | 
					
						
							| 
									
										
										
										
											2013-02-27 12:04:35 +08:00
										 |  |  |                                 'type' => 'VARCHAR', | 
					
						
							|  |  |  |                                 'constraint' => 1, | 
					
						
							|  |  |  |                         ), | 
					
						
							|  |  |  |                 )); | 
					
						
							| 
									
										
										
										
											2025-08-18 21:07:43 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-02-27 12:04:35 +08:00
										 |  |  |                 $this->dbforge->create_table('config'); | 
					
						
							| 
									
										
										
										
											2025-08-18 21:07:43 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  |                 $data = array( | 
					
						
							|  |  |  |                         'lotw_download_url' => 'https://p1k.arrl.org/lotwuser/lotwreport.adi', | 
					
						
							|  |  |  |                         'lotw_upload_url' => 'https://p1k.arrl.org/lotwuser/upload', | 
					
						
							|  |  |  |                         'lotw_rcvd_mark' => 'Y' | 
					
						
							|  |  |  |                 ); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |                 $this->db->insert('config', $data); | 
					
						
							| 
									
										
										
										
											2013-02-27 12:04:35 +08:00
										 |  |  |         } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         public function down() | 
					
						
							|  |  |  |         { | 
					
						
							|  |  |  |                 $this->dbforge->drop_table('config'); | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  | } |