| 
									
										
										
										
											2022-10-19 22:27:26 +08:00
										 |  |  | <?php | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | defined('BASEPATH') OR exit('No direct script access allowed'); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /* | 
					
						
							| 
									
										
										
										
											2022-10-20 01:25:07 +08:00
										 |  |  |  *   This adds an option to enable grid lookup | 
					
						
							|  |  |  |  *   by location entered | 
					
						
							| 
									
										
										
										
											2022-10-19 22:27:26 +08:00
										 |  |  | */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class Migration_user_auto_qth_option extends CI_Migration { | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	public function up() | 
					
						
							|  |  |  | 	{ | 
					
						
							| 
									
										
										
										
											2022-10-20 01:33:14 +08:00
										 |  |  | 		if (!$this->db->field_exists('user_qth_lookup', 'users')) { | 
					
						
							| 
									
										
										
										
											2022-10-19 22:27:26 +08:00
										 |  |  | 			$fields = array( | 
					
						
							| 
									
										
										
										
											2022-10-20 01:25:07 +08:00
										 |  |  | 				'user_qth_lookup integer DEFAULT 0 AFTER user_wwff_lookup', | 
					
						
							| 
									
										
										
										
											2022-10-19 22:27:26 +08:00
										 |  |  | 			); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 			$this->dbforge->add_column('users', $fields); | 
					
						
							|  |  |  | 		} | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	public function down() | 
					
						
							|  |  |  | 	{ | 
					
						
							| 
									
										
										
										
											2022-10-20 01:25:07 +08:00
										 |  |  | 		if ($this->db->field_exists('user_qth_lookup', 'users')) { | 
					
						
							|  |  |  | 			$this->dbforge->drop_column('users', 'user_qth_lookup'); | 
					
						
							| 
									
										
										
										
											2022-10-19 22:27:26 +08:00
										 |  |  | 		} | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | } |