Added eQSL_AG

This commit is contained in:
Andreas Kristiansen
2025-09-28 11:03:32 +02:00
parent 3fb510e5a7
commit b5009f8283

View File

@@ -51,6 +51,17 @@ class Migration_adif_3_1_6 extends CI_Migration {
$this->db->insert('contest', $contest);
}
}
$table_name = $this->config->item('table_name');
$qso_fields = [];
$col_check = $this->db->query("SHOW COLUMNS FROM `$table_name` LIKE 'COL_EQSL_AG';")->num_rows() > 0;
if (!$col_check) {
$qso_fields[] = "ALTER TABLE `$table_name` ADD COLUMN COL_EQSL_AG VARCHAR(10) DEFAULT NULL AFTER COL_EQSL_STATUS;";
} else {
log_message('info', 'Column "COL_EQSL_AG" already exists, skipping ALTER TABLE.');
}
}
public function down() {
@@ -88,4 +99,12 @@ class Migration_adif_3_1_6 extends CI_Migration {
$this->db->delete('contest');
}
function dbtry($what) {
try {
$this->db->query($what);
} catch (Exception $e) {
log_message("error", "Something gone wrong while altering a table: ".$e." // Executing: ".$this->db->last_query());
}
}
}