Cloudlog/application/migrations/209_lotw_cert_archive_status.php
Peter Goodhall 67a652bce6 Add archive status for LoTW certificates
Introduces an 'archived' boolean column to the lotw_certs table via migration, adds model and controller logic to toggle archive status, and updates the view to display and allow archiving/unarchiving of certificates. This enables users to mark LoTW certificates as archived for better management.
2025-08-22 17:15:51 +01:00

30 行
673 B
PHP

<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/**
* Class Migration_lotw_cert_archive_status
*
* Adds a simple boolean `archived` column to the `lotw_certs` table so
* certificates can be marked as archived.
*/
class Migration_lotw_cert_archive_status extends CI_Migration {
public function up()
{
if (! $this->db->field_exists('archived', 'lotw_certs')) {
$fields = array(
'archived BOOLEAN DEFAULT FALSE',
);
$this->dbforge->add_column('lotw_certs', $fields);
}
}
public function down()
{
if ($this->db->field_exists('archived', 'lotw_certs')) {
$this->dbforge->drop_column('lotw_certs', 'archived');
}
}
}