Added Migration to delete the LoTW User List table and removed some unneeded coded

pull/627/head
Peter Goodhall 2020-09-21 14:10:55 +01:00
rodzic d4a164fc94
commit 235c977040
4 zmienionych plików z 18 dodań i 46 usunięć

Wyświetl plik

@ -21,7 +21,7 @@ $config['migration_enabled'] = TRUE;
| be upgraded / downgraded to.
|
*/
$config['migration_version'] = 50;
$config['migration_version'] = 51;
/*
|--------------------------------------------------------------------------

Wyświetl plik

@ -632,14 +632,7 @@ class API extends CI_Controller {
* Check if callsign is active on LOTW
*
*/
$this->load->model('lotw_user');
$lotw_member = $this->lotw_user->check($lookup_callsign);
if($lotw_member == "not found") {
$return['lotw_member'] = false;
} else {
$return['lotw_member'] = true;
}
/*
*

Wyświetl plik

@ -0,0 +1,16 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Migration_delete_lotw_userlist_table extends CI_Migration {
public function up()
{
$this->dbforge->drop_table('lotw_userlist');
}
public function down()
{
echo "not possible";
}
}

Wyświetl plik

@ -1,37 +0,0 @@
<?php
class Lotw_user extends CI_Model {
function __construct()
{
// Call the Model constructor
parent::__construct();
}
function empty_table() {
$this->db->empty_table('lotw_userlist');
}
function add_lotwuser($callsign, $date) {
$data = array(
'callsign' => $callsign,
'upload_date' => $date
);
$this->db->insert('lotw_userlist', $data);
}
function check($callsign) {
$this->db->where('callsign', $callsign);
$query = $this->db->get('lotw_userlist');
if ($query->num_rows() > 0) {
return "active";
} else {
return "not found";
}
}
}
?>