Several additions and fixes.
Added primary keys and set barcode to UNIQUE