Add unique constraint for code