Fix an update bug on request time

This commit is contained in:
Andreas Kristiansen
2025-08-13 09:32:14 +02:00
parent 2699930172
commit a9dff350a5

View File

@@ -8,6 +8,7 @@ class Migration_add_oqrs_cascade extends CI_Migration {
$this->dbtry("ALTER TABLE oqrs MODIFY COLUMN qsoid BIGINT(20) UNSIGNED;");
$this->dbtry("ALTER TABLE oqrs ADD UNIQUE (qsoid)");
$this->dbtry("ALTER TABLE oqrs ADD CONSTRAINT oqrs_logbook_fk FOREIGN KEY (qsoid) REFERENCES " . $this->config->item('table_name') . " (COL_PRIMARY_KEY) ON DELETE CASCADE ON UPDATE RESTRICT;");
$this->dbtry("ALTER TABLE oqrs MODIFY requesttime TIMESTAMP DEFAULT CURRENT_TIMESTAMP;");
}
public function down(){
@@ -19,7 +20,7 @@ class Migration_add_oqrs_cascade extends CI_Migration {
try {
$this->db->query($what);
} catch (Exception $e) {
log_message("error", "Something gone wrong while altering FKs: ".$e." // Executing: ".$this->db->last_query());
log_message("error", "Something gone wrong while altering the OQRS table: ".$e." // Executing: ".$this->db->last_query());
}
}
}