Merge pull request #2590 from HB9HIL/correct-default-bandgroup-migration

correction of default bandgroup as migration
pull/2593/head
Peter Goodhall 2023-10-18 21:16:49 +01:00 zatwierdzone przez GitHub
commit 01204f2d3e
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
2 zmienionych plików z 27 dodań i 1 usunięć

Wyświetl plik

@ -22,7 +22,7 @@ $config['migration_enabled'] = TRUE;
|
*/
$config['migration_version'] = 145;
$config['migration_version'] = 146;
/*
|--------------------------------------------------------------------------

Wyświetl plik

@ -0,0 +1,26 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/*
*
* Correction of the default bandgroup of 160m, 23cm and 13cm
*
*/
class Migration_correct_default_bandgroup extends CI_Migration {
public function up()
{
$this->db->query("UPDATE bands SET bandgroup = 'mf' WHERE band = '160m' AND bandgroup = 'hf';");
$this->db->query("UPDATE bands SET bandgroup = 'uhf' WHERE band = '23cm' AND bandgroup = 'shf';");
$this->db->query("UPDATE bands SET bandgroup = 'uhf' WHERE band = '13cm' AND bandgroup = 'shf';");
}
public function down()
{
$this->db->query("UPDATE bands SET bandgroup = 'hf' WHERE band = '160m' AND bandgroup = 'mf';");
$this->db->query("UPDATE bands SET bandgroup = 'shf' WHERE band = '23cm' AND bandgroup = 'uhf';");
$this->db->query("UPDATE bands SET bandgroup = 'shf' WHERE band = '13cm' AND bandgroup = 'uhf';");
}
}