diff --git a/application/migrations/266_add_lotw_cert_serial.php b/application/migrations/266_add_lotw_cert_serial.php new file mode 100644 index 000000000..45dd892db --- /dev/null +++ b/application/migrations/266_add_lotw_cert_serial.php @@ -0,0 +1,25 @@ +dbtry("ALTER TABLE lotw_certs ADD COLUMN serial INT DEFAULT NULL AFTER lotw_cert_id"); + $this->dbtry("ALTER TABLE lotw_certs ADD COLUMN status TINYINT DEFAULT 0 AFTER serial"); + } + + public function down() + { + $this->dbtry("ALTER TABLE lotw_certs DROP COLUMN status"); + $this->dbtry("ALTER TABLE lotw_certs DROP COLUMN serial"); + } + + function dbtry($what) { + try { + $this->db->query($what); + } catch (Exception $e) { + log_message("error", "Error modifying columns in lotw_certs: ".$e." // Executing: ".$this->db->last_query()); + } + } +}