This commit is contained in:
Andreas Kristiansen
2025-10-14 08:13:58 +02:00
parent 41fd6df213
commit 386d91a6e9
2 changed files with 5 additions and 7 deletions

View File

@@ -255,9 +255,9 @@ class Update extends CI_Controller {
}
// Clear the tables, ready for new data
$this->db->empty_table("dxcc_entities");
$this->db->empty_table("dxcc_exceptions");
$this->db->empty_table("dxcc_prefixes");
$this->db->query("TRUNCATE TABLE dxcc_entities");
$this->db->query("TRUNCATE TABLE dxcc_exceptions");
$this->db->query("TRUNCATE TABLE dxcc_prefixes");
$this->update_status();
// Parse the three sections of the file and update the tables

View File

@@ -287,8 +287,7 @@ class Update_model extends CI_Model {
}
rewind($f);
$this->db->empty_table("lotw_users");
$this->db->query("ALTER TABLE lotw_users AUTO_INCREMENT 1");
$this->db->query("TRUNCATE TABLE lotw_users");
$i = 0;
$data = fgetcsv($f, 1000, ",", '"', '\\');
do {
@@ -564,8 +563,7 @@ class Update_model extends CI_Model {
if ($http_result['http_code'] == "200") {
$lines = explode("\n", $response);
if (count($lines) > 0) { // Check if there was data, otherwise skip parsing / truncating the table and preserve whats there
$this->db->empty_table("hams_of_note");
$this->db->query("ALTER TABLE hams_of_note AUTO_INCREMENT 1");
$this->db->query("TRUNCATE TABLE hams_of_note");
$i = 0;
foreach($lines as $data) {
$line = trim($data);