Update 100_update_cat_table.php

pull/1624/head
Peter Goodhall 2022-09-30 15:54:11 +01:00
rodzic dd1e224d7f
commit de9445fd7b
1 zmienionych plików z 4 dodań i 4 usunięć

Wyświetl plik

@ -18,10 +18,10 @@ class Migration_update_cat_table extends CI_Migration {
$this->dbforge->drop_column('cat', 'uplink_mode'); $this->dbforge->drop_column('cat', 'uplink_mode');
} }
if ($this->db->field_exists('downlink_freq', 'cat')) { if ($this->db->field_exists('downlink_freq', 'cat')) {
$this->db->query("ALTER TABLE cat RENAME COLUMN downlink_freq TO frequency_rx"); $this->db->query("ALTER TABLE cat CHANGE COLUMN downlink_freq TO frequency_rx");
} }
if ($this->db->field_exists('downlink_mode', 'cat')) { if ($this->db->field_exists('downlink_mode', 'cat')) {
$this->db->query("ALTER TABLE cat RENAME COLUMN downlink_mode TO mode_rx"); $this->db->query("ALTER TABLE cat CHANGE COLUMN downlink_mode TO mode_rx");
} }
} }
} }
@ -30,10 +30,10 @@ class Migration_update_cat_table extends CI_Migration {
{ {
if ($this->db->table_exists('cat')) { if ($this->db->table_exists('cat')) {
if ($this->db->field_exists('frequency_rx', 'cat')) { if ($this->db->field_exists('frequency_rx', 'cat')) {
$this->db->query("ALTER TABLE cat RENAME COLUMN frequency_rx TO downlink_freq"); $this->db->query("ALTER TABLE cat CHANGE COLUMN frequency_rx TO downlink_freq");
} }
if ($this->db->field_exists('mode_rx', 'cat')) { if ($this->db->field_exists('mode_rx', 'cat')) {
$this->db->query("ALTER TABLE cat RENAME COLUMN mode_rx TO downlink_mode"); $this->db->query("ALTER TABLE cat CHANGE COLUMN mode_rx TO downlink_mode");
} }
if (!$this->db->field_exists('uplink_freq', 'cat')) { if (!$this->db->field_exists('uplink_freq', 'cat')) {
$fields = array( $fields = array(