Drop a not used column to simplify

This commit is contained in:
Laurent Destailleur 2025-11-11 01:20:26 +01:00
parent cc7f297b47
commit 78cb2e0294
4 changed files with 4 additions and 16 deletions

View file

@ -297,7 +297,6 @@ if (GETPOST('downloadcsv', 'alpha')) {
$block_static->object_version = $obj->object_version; // Not in signature
$block_static->object_format = $obj->object_format; // Not in signature
$block_static->signature_line = $obj->signature_line;
$block_static->certified = ($obj->certified == 1);
$block_static->linktoref = $obj->linktoref;

View file

@ -66,12 +66,6 @@ class BlockedLog
*/
public $signature = '';
/**
* Unique fingerprint of the line log content
* @var string
*/
public $signature_line = '';
/**
* @var float|string|null
*/
@ -869,7 +863,7 @@ class BlockedLog
return -1;
}
$sql = "SELECT b.rowid, b.date_creation, b.signature, b.signature_line, b.amounts, b.action, b.element, b.fk_object, b.entity,";
$sql = "SELECT b.rowid, b.date_creation, b.signature, b.amounts, b.action, b.element, b.fk_object, b.entity,";
$sql .= " b.certified, b.tms, b.fk_user, b.user_fullname, b.date_object, b.ref_object, b.object_data, b.object_version, b.object_format";
$sql .= " FROM ".MAIN_DB_PREFIX."blockedlog as b";
if ($id) {
@ -902,7 +896,6 @@ class BlockedLog
$this->object_format = $obj->object_format;
$this->signature = $obj->signature;
$this->signature_line = $obj->signature_line;
$this->certified = ($obj->certified == 1);
return 1;
@ -1040,20 +1033,17 @@ class BlockedLog
// For debug:
$this->debuginfo = $this->buildFirstPartOfKeyForSignature(); // Note used
// signature_line is useless. Abandoned.
//$this->signature_line = dol_hash($concatenatedata, '5'); // Not really useful
if ($forcesignature) {
$this->signature = $forcesignature;
}
//var_dump($concatenatedata);var_dump($previoushash);var_dump($this->signature_line);var_dump($this->signature);
//var_dump($concatenatedata);var_dump($previoushash);var_dump($this->signature);
$sql = "INSERT INTO ".MAIN_DB_PREFIX."blockedlog (";
$sql .= " date_creation,";
$sql .= " action,";
$sql .= " amounts,";
$sql .= " signature,";
$sql .= " signature_line,";
$sql .= " element,";
$sql .= " fk_object,";
$sql .= " date_object,";
@ -1071,7 +1061,6 @@ class BlockedLog
$sql .= "'".$this->db->escape($this->action)."',";
$sql .= $this->amounts.",";
$sql .= "'".$this->db->escape($this->signature)."',";
$sql .= "'".$this->db->escape($this->signature_line)."',";
$sql .= "'".$this->db->escape($this->element)."',";
$sql .= (int) $this->fk_object.",";
$sql .= "'".$this->db->idate($this->date_object)."',";
@ -1138,7 +1127,6 @@ class BlockedLog
// Build the string for the signature
$concatenatedata = $this->buildKeyForSignature();
//$signature_line = dol_hash($concatenatedata, '5'); // Not useful. Abandoned.
$signature = $this->buildFinalSignatureHash($previoushash.$concatenatedata);
} catch (Exception $e) {
$res = ($signature === $this->signature);

View file

@ -339,4 +339,6 @@ INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'CDF'
ALTER TABLE llx_societe MODIFY COLUMN mode_reglement integer;
ALTER TABLE llx_blockedlog DROP COLUMN signature_line;
-- end of migration

View file

@ -37,7 +37,6 @@ CREATE TABLE llx_blockedlog
element varchar(50),
fk_user integer,
fk_object integer,
signature_line varchar(100) NOT NULL, -- the hash of the key for signature for line only so without previous hash before (not used)
object_version varchar(32) DEFAULT '', -- in which version did the line was recorded
certified integer,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,