Store when barcode was last scanned
All checks were successful
Docker Image CI / build (push) Successful in 14m3s
All checks were successful
Docker Image CI / build (push) Successful in 14m3s
This commit is contained in:
@ -0,0 +1,7 @@
|
||||
ALTER TABLE item_barcodes
|
||||
ADD COLUMN IF NOT EXISTS last_scanned_at timestamptz NOT NULL DEFAULT current_timestamp;
|
||||
|
||||
UPDATE item_barcodes
|
||||
SET last_scanned_at = created_at
|
||||
FROM item_purchases
|
||||
WHERE item_barcodes.item_id = item_purchases.item_id AND is_last_purchase = true;
|
Reference in New Issue
Block a user