Add FreeDV and M17 submodes of digital voice
这个提交包含在:
父节点
4d129170de
当前提交
013493baca
共有 2 个文件被更改,包括 50 次插入 和 1 次删除
|
|
@ -21,7 +21,7 @@ $config['migration_enabled'] = TRUE;
|
||||||
| be upgraded / downgraded to.
|
| be upgraded / downgraded to.
|
||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
$config['migration_version'] = 107;
|
$config['migration_version'] = 109;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,49 @@
|
||||||
|
<?php
|
||||||
|
defined('BASEPATH') or exit('No direct script access allowed');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class Migration_add_m17_and_freedv
|
||||||
|
*
|
||||||
|
* Add M17 and FREEDV sub modes
|
||||||
|
* See http://adif.org.uk/314/ADIF_314_annotated.htm
|
||||||
|
*/
|
||||||
|
|
||||||
|
class Migration_add_m17_and_freedv extends CI_Migration
|
||||||
|
{
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
// insert new FREEDV
|
||||||
|
$query = $this->db->get_where('adif_modes', array('submode' => 'FREEDV'));
|
||||||
|
if ($query->num_rows() == 0) {
|
||||||
|
$data = array(
|
||||||
|
array('mode' => "DIGITALVOICE", 'submode' => "FREEDV", 'qrgmode' => "DATA", 'active' => 1),
|
||||||
|
);
|
||||||
|
$this->db->insert_batch('adif_modes', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
// insert new M17
|
||||||
|
$query = $this->db->get_where('adif_modes', array('submode' => 'M17'));
|
||||||
|
if ($query->num_rows() == 0) {
|
||||||
|
$data = array(
|
||||||
|
array('mode' => "DIGITALVOICE", 'submode' => "M17", 'qrgmode' => "DATA", 'active' => 1),
|
||||||
|
);
|
||||||
|
$this->db->insert_batch('adif_modes', $data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
$query = $this->db->get_where('adif_modes', array('submode' => 'M17'));
|
||||||
|
if ($query->num_rows() > 0) {
|
||||||
|
$this->db->where('mode', 'DIGITALVOICE');
|
||||||
|
$this->db->where('submode', 'M17');
|
||||||
|
$this->db->delete('adif_modes');
|
||||||
|
}
|
||||||
|
$query = $this->db->get_where('adif_modes', array('submode' => 'FREEDV'));
|
||||||
|
if ($query->num_rows() > 0) {
|
||||||
|
$this->db->where('mode', 'DIGITALVOICE');
|
||||||
|
$this->db->where('submode', 'FREEDV');
|
||||||
|
$this->db->delete('adif_modes');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
正在加载…
在新工单中引用