History

historyDATA STRUCTURE
idSERIAL
record_idINTEGER
change_timeTIMESTAMP
old_quantityREAL
new_quantityREAL

History is a table that automatically logs the change of a record's quantity, to use the 'sum' table.