cloudlog/application/migrations/251_add_ft2_submode.php
Peter Goodhall e233839127 Add FT2 MFSK submode migration, bump version
Adds migration 251_add_ft2_submode.php which inserts a new 'FT2' submode under mode 'MFSK' into the adif_modes table (qrgmode='DATA', active=1) if it doesn't already exist, and provides a down() to remove it. Also bumps application migration_version to 251. Note: FT2 is not part of the ADIF spec yet.
2026-02-20 18:27:53 +00:00

35 lines
818 B
PHP

<?php
defined('BASEPATH') or exit('No direct script access allowed');
/**
* Class Migration_add_ft2_submode
*
* Add FT2 submode under MFSK
* This isn't part of the ADIF Spec yet
*/
class Migration_add_ft2_submode extends CI_Migration
{
public function up()
{
// insert new FT4
$query = $this->db->get_where('adif_modes', array('submode' => 'FT2'));
if ($query->num_rows() == 0) {
$data = array(
array('mode' => "MFSK", 'submode' => "FT2", 'qrgmode' => "DATA", 'active' => 1),
);
$this->db->insert_batch('adif_modes', $data);
}
}
public function down()
{
$query = $this->db->get_where('adif_modes', array('submode' => 'FT2'));
if ($query->num_rows() > 0) {
$this->db->where('mode', 'MFSK');
$this->db->where('submode', 'FT2');
$this->db->delete('adif_modes');
}
}
}
?>