hook_user_presave at user registration, how to get field_data_field (set to auto increment) to take a new and unique value I'm trying to force a parallel identifier (to match up legacy system requirements) to correlate to uid by means of a field_data_field_foo table.

The field_data_field_foo was created in the Field UI and because I couldn't see any UNIQUE and AUTO_INCREMENT options I set them both for the column field_data_field_foo.field_foo_value in phpMyAdmin. 

I assumed this would be enough to force the issue, but in development I setup a hook_user_presave() function in my custom module and with a break point inside it, for $account-&gt;field_foo I just get undefined.... 

field_foo   Array [1]   
    und Array [0]   


Because this is something that must be assigned uniquely and I'd like to assign at the point of registration should I be using a different hook? Or is there something else I'm missing? 

Btw, it might be something more basic in Drupal that I'm missing as I'm not that experienced with it atm - i.e. due to the nature of this project, I've yet to spend time learning nodes and the like.
Here's what I did in the end...

First I added the field to the user registration form, as one thing Drupal is great at is processing information - I did notice errors being caught so I might have to check that out.

Then I used hook_user_presave() and (managing the unique id creation seperately) passed that, overriding any existing value or adding a value if none existed.

(full details are here: Editing user submission of user registration form with hook_user_insert() and $edit)

I will still have to manage away the users ability to insert an identifier by hiding it through CSS/JavaScript etc. but because hook_form_alter() wouldn't edit the user registration form after repeat attempts this seems the most expedient way of solving the problem.