Add unique constraint to uuid column.

This also adds a btree index to this column, converting a few seq scans
into index only scans.