Update qso_end_date of existing certs where time is 00:00:00

pull/2235/head^2
phl0 2023-07-01 23:06:31 +02:00
rodzic 0c0e9219a3
commit 08765a8bd8
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 48EA1E640798CA9A
2 zmienionych plików z 22 dodań i 1 usunięć

Wyświetl plik

@ -21,7 +21,7 @@ $config['migration_enabled'] = TRUE;
| be upgraded / downgraded to.
|
*/
$config['migration_version'] = 124;
$config['migration_version'] = 125;
/*
|--------------------------------------------------------------------------

Wyświetl plik

@ -0,0 +1,21 @@
<?php
defined('BASEPATH') or exit('No direct script access allowed');
class Migration_lotw_enddates extends CI_Migration
{
public function up()
{
if ($this->db->table_exists('lotw_certs')) {
$sql = 'UPDATE lotw_certs SET qso_end_date = DATE_ADD(qso_end_date, INTERVAL 24*60*60 -1 SECOND) WHERE TIME(qso_end_date) = "00:00:00";';
$this->db->query($sql);
}
}
public function down()
{
if ($this->db->table_exists('lotw_certs')) {
$sql = 'UPDATE lotw_certs SET qso_end_date = DATE_SUB(qso_end_date, INTERVAL 24*60*60 -1 SECOND) WHERE TIME(qso_end_date) = "23:59:59";';
$this->db->query($sql);
}
}
}