Make it more failsafe

pull/2927/head
phl0 2024-01-20 13:57:26 +01:00
rodzic c2deb80b0d
commit e20e3dc597
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 48EA1E640798CA9A
1 zmienionych plików z 7 dodań i 4 usunięć

Wyświetl plik

@ -7,15 +7,18 @@ class Migration_add_key_to_lotw_certs extends CI_Migration {
public function up()
{
$fields = array(
'cert_key TEXT',
'cert_key TEXT',
);
$this->dbforge->add_column('lotw_certs', $fields);
if (!$this->db->field_exists('cert_key', 'lotw_certs')) {
$this->dbforge->add_column('lotw_certs', $fields);
}
}
public function down()
{
$this->dbforge->drop_column('lotw_certs', 'cert_key');
if ($this->db->field_exists('cert_key', 'lotw_certs')) {
$this->dbforge->drop_column('lotw_certs', 'cert_key');
}
}
}