From 013493bacadcfc2c733c6580b855c5b5b0fdd715 Mon Sep 17 00:00:00 2001 From: phl0 Date: Wed, 7 Dec 2022 09:06:35 +0100 Subject: [PATCH] Add FreeDV and M17 submodes of digital voice --- application/config/migration.php | 2 +- .../migrations/109_add_m17_and_freedv.php | 49 +++++++++++++++++++ 2 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 application/migrations/109_add_m17_and_freedv.php diff --git a/application/config/migration.php b/application/config/migration.php index c194c1fd..bb486284 100644 --- a/application/config/migration.php +++ b/application/config/migration.php @@ -21,7 +21,7 @@ $config['migration_enabled'] = TRUE; | be upgraded / downgraded to. | */ -$config['migration_version'] = 107; +$config['migration_version'] = 109; /* |-------------------------------------------------------------------------- diff --git a/application/migrations/109_add_m17_and_freedv.php b/application/migrations/109_add_m17_and_freedv.php new file mode 100644 index 00000000..4fcb06d2 --- /dev/null +++ b/application/migrations/109_add_m17_and_freedv.php @@ -0,0 +1,49 @@ +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'); + } + } +}