diff --git a/application/migrations/238_add_norad_id_to_sat.php b/application/migrations/238_add_norad_id_to_sat.php new file mode 100644 index 000000000..a433b0017 --- /dev/null +++ b/application/migrations/238_add_norad_id_to_sat.php @@ -0,0 +1,29 @@ +db->table_exists('satellite')) { + $fields = array( + 'norad_id' => array( + 'type' => 'INT', + 'constraint' => 9, + 'unsigned' => TRUE, + 'null' => TRUE, + 'default' => NULL + ), + ); + $this->dbforge->add_column('satellite', $fields); + } + } + + public function down() { + if ($this->db->table_exists('satellite')) { + if ($this->db->field_exists('norad_id', 'satellite')) { + $this->dbforge->drop_column('satellite', 'norad_id'); + } + } + } +}