db->table_exists('dxpedition')) { $this->dbforge->add_field(array( 'id' => array( 'type' => 'INT', 'constraint' => 6, 'unsigned' => TRUE, 'auto_increment' => TRUE, 'null' => FALSE ), 'start_date' => array( 'type' => 'DATE', 'null' => TRUE, ), 'end_date' => array( 'type' => 'DATE', 'null' => TRUE, ), 'callsign' => array( 'type' => 'VARCHAR', 'constraint' => '255', 'null' => FALSE, ), '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'); } }