Fix: missing unique key on barcode field to avoid database corruption