| 
									
										
										
										
											2024-03-27 11:08:16 +08:00
										 |  |  | <?php | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-03-28 23:22:01 +08:00
										 |  |  | defined('BASEPATH') or exit('No direct script access allowed'); | 
					
						
							| 
									
										
										
										
											2024-03-27 11:08:16 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-03-28 23:22:01 +08:00
										 |  |  | class Migration_add_sstv_images_table extends CI_Migration | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2024-03-27 11:08:16 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  |         public function up() | 
					
						
							|  |  |  |         { | 
					
						
							| 
									
										
										
										
											2024-03-28 23:22:01 +08:00
										 |  |  |                 // if sstv_images table doesn't exist
 | 
					
						
							|  |  |  |                 if (!$this->db->table_exists('sstv_images')) { | 
					
						
							|  |  |  |                         $this->dbforge->add_field(array( | 
					
						
							|  |  |  |                                 'id' => array( | 
					
						
							|  |  |  |                                         'type' => 'INT', | 
					
						
							|  |  |  |                                         'constraint' => 5, | 
					
						
							|  |  |  |                                         'unsigned' => TRUE, | 
					
						
							|  |  |  |                                         'auto_increment' => TRUE | 
					
						
							|  |  |  |                                 ), | 
					
						
							|  |  |  |                                 'qsoid' => array( | 
					
						
							|  |  |  |                                         'type' => 'VARCHAR', | 
					
						
							|  |  |  |                                         'constraint' => '250', | 
					
						
							|  |  |  |                                 ), | 
					
						
							|  |  |  |                                 'filename' => array( | 
					
						
							|  |  |  |                                         'type' => 'VARCHAR', | 
					
						
							|  |  |  |                                         'constraint' => '250', | 
					
						
							|  |  |  |                                 ), | 
					
						
							|  |  |  |                                 'modified' => array( | 
					
						
							|  |  |  |                                         'type' => 'timestamp', | 
					
						
							|  |  |  |                                         'null' => TRUE, | 
					
						
							|  |  |  |                                 ), | 
					
						
							|  |  |  |                         )); | 
					
						
							|  |  |  |                         $this->dbforge->add_key('id', TRUE); | 
					
						
							|  |  |  |                         $this->dbforge->create_table('sstv_images'); | 
					
						
							|  |  |  |                 } | 
					
						
							| 
									
										
										
										
											2024-03-27 11:08:16 +08:00
										 |  |  |         } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         public function down() | 
					
						
							|  |  |  |         { | 
					
						
							|  |  |  |                 echo "not possible"; | 
					
						
							|  |  |  |         } | 
					
						
							| 
									
										
										
										
											2024-03-28 23:22:01 +08:00
										 |  |  | } |