| 
									
										
										
										
											2023-11-23 22:19:10 +08:00
										 |  |  | <?php | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | defined('BASEPATH') or exit('No direct script access allowed'); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /* | 
					
						
							|  |  |  | *   Create a dxpedition table | 
					
						
							|  |  |  | */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class Migration_create_dxpedition_table extends CI_Migration | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     public function up() | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         /* check if the dxpedition table exists if not create dxpedition table */ | 
					
						
							|  |  |  |         if (!$this->db->table_exists('dxpedition')) { | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |             $this->dbforge->add_field(array( | 
					
						
							|  |  |  |                 'id' => array( | 
					
						
							|  |  |  |                     'type' => 'INT', | 
					
						
							|  |  |  |                     'constraint' => 6, | 
					
						
							|  |  |  |                     'unsigned' => TRUE, | 
					
						
							| 
									
										
										
										
											2023-11-24 14:44:46 +08:00
										 |  |  |                     'auto_increment' => TRUE, | 
					
						
							|  |  |  |                     'null' => FALSE | 
					
						
							| 
									
										
										
										
											2023-11-23 22:19:10 +08:00
										 |  |  |                 ), | 
					
						
							|  |  |  |                 'start_date' => array( | 
					
						
							|  |  |  |                     'type' => 'DATE', | 
					
						
							|  |  |  |                     'null' => TRUE, | 
					
						
							|  |  |  |                 ), | 
					
						
							|  |  |  |                 'end_date' => array( | 
					
						
							|  |  |  |                     'type' => 'DATE', | 
					
						
							|  |  |  |                     'null' => TRUE, | 
					
						
							|  |  |  |                 ), | 
					
						
							|  |  |  |                 'callsign' => array( | 
					
						
							|  |  |  |                     'type' => 'VARCHAR', | 
					
						
							|  |  |  |                     'constraint' => '255', | 
					
						
							| 
									
										
										
										
											2023-11-24 14:44:46 +08:00
										 |  |  |                     'null' => FALSE, | 
					
						
							| 
									
										
										
										
											2023-11-23 22:19:10 +08:00
										 |  |  |                 ), | 
					
						
							|  |  |  |                 'country' => array( | 
					
						
							|  |  |  |                     'type' => 'VARCHAR', | 
					
						
							|  |  |  |                     'constraint' => '255', | 
					
						
							|  |  |  |                     'null' => TRUE, | 
					
						
							|  |  |  |                 ), | 
					
						
							|  |  |  |                 'notes' => array( | 
					
						
							|  |  |  |                     'type' => 'VARCHAR', | 
					
						
							|  |  |  |                     'constraint' => '255', | 
					
						
							|  |  |  |                     'null' => TRUE, | 
					
						
							|  |  |  |                 ), | 
					
						
							|  |  |  |             )); | 
					
						
							|  |  |  |             $this->dbforge->add_key('id', TRUE); | 
					
						
							|  |  |  |             $this->dbforge->add_key('callsign', TRUE); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |             $this->dbforge->create_table('dxpedition'); | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     public function down() | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         $this->dbforge->drop_table('dxpedition'); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | } |