Only create the fields in db if they arent there

pull/1218/head
Peter Goodhall 2021-09-27 15:07:38 +01:00
rodzic 99b7290412
commit e8be6f8620
2 zmienionych plików z 6 dodań i 2 usunięć

Wyświetl plik

@ -10,7 +10,9 @@ class Migration_add_userid_to_station_profiles extends CI_Migration {
'user_id BIGINT(20) DEFAULT NULL',
);
$this->dbforge->add_column('station_profile', $fields);
if (!$this->db->field_exists('user_id', 'station_profile')) {
$this->dbforge->add_column('station_profile', $fields);
}
}
public function down()

Wyświetl plik

@ -15,7 +15,9 @@ class Migration_add_active_station_logbook_to_user_table extends CI_Migration {
'active_station_logbook int(11)',
);
$this->dbforge->add_column('users', $fields);
if (!$this->db->field_exists('active_station_logbook', 'users')) {
$this->dbforge->add_column('users', $fields);
}
}
public function down()