mirror of
https://github.com/wavelog/wavelog.git
synced 2026-03-22 10:24:14 +00:00
Added eQSL_AG
This commit is contained in:
@@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user