mirror of
https://github.com/magicbug/Cloudlog
synced 2026-08-13 17:49:35 -04:00
[Migration] Added an extra if check to avoid errors
This commit is contained in:
parent
cc0decae27
commit
d613943973
1 changed files with 5 additions and 4 deletions
|
|
@ -13,10 +13,11 @@ class Migration_make_lotw_use_dxcc_id extends CI_Migration
|
|||
$this->dbforge->add_column('lotw_certs', $fields);
|
||||
}
|
||||
|
||||
$sql = 'UPDATE `lotw_certs` JOIN `dxcc_entities` ON `lotw_certs`.`cert_dxcc` = `dxcc_entities`.`name` SET `lotw_certs`.`cert_dxcc_id` = `dxcc_entities`.`adif`;';
|
||||
$this->db->query($sql);
|
||||
|
||||
$this->dbforge->drop_column('lotw_certs', 'cert_dxcc');
|
||||
if ($this->db->field_exists('cert_dxcc', 'lotw_certs')) {
|
||||
$sql = 'UPDATE `lotw_certs` JOIN `dxcc_entities` ON `lotw_certs`.`cert_dxcc` = `dxcc_entities`.`name` SET `lotw_certs`.`cert_dxcc_id` = `dxcc_entities`.`adif`;';
|
||||
$this->db->query($sql);
|
||||
$this->dbforge->drop_column('lotw_certs', 'cert_dxcc');
|
||||
}
|
||||
}
|
||||
|
||||
public function down()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue